LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to rotate a picture or pixmap?

hello all,

I read from jpeg files some pictures and display it in a picture control.

I would like to rotate (90°,180°,270°) or miror the content of this picture control.

Could someone give me a hint or a solution of how to do that?


I did not find any property or invoke node to do that. I think that I have to convert to a pixmap and manipulate the array but I don't know how.

I use LV 8.0 Pro.

Thanks in advance.
0 Kudos
Message 1 of 8
(15,341 Views)
I wrote a program to rotate images from JPEG files. It obtains pixmap and rotates the array. When I tried to save it for 8.0, some functions were not available in that version so I can't send it to you. I cleaned it up a bit. It is not quite the same as my 8.2 version but it works. It is rather slow on large files: a 7.3 megapixel image takes tens of seconds to rotate. I have not worked much on trying to optimize it yet.

Lynn
0 Kudos
Message 2 of 8
(15,331 Views)
I sucessfully did some transformation but the 180° is still missing, could someone give me a hint (algorithm)?

See attached VI
Message 3 of 8
(15,330 Views)
thanks johnsold, our messages were posted at the same time.

Anyway I can't open you VI (I have an error because your VI is made with LV 8.2).
0 Kudos
Message 4 of 8
(15,328 Views)
Can't you just run your rotate 90 degree code twice?
0 Kudos
Message 5 of 8
(15,324 Views)

On a side-note: if you want to ratate by arbitrary angles, you could do something like in the example I posted long ago:

http://forums.ni.com/ni/board/message?board.id=BreakPoint&message.id=748#M748

 

 

0 Kudos
Message 6 of 8
(15,321 Views)
To rotate by 180, I would do it "in place". Probably cheaper than 2 succesive 90degree rotations.
 
 
See if this works for you:

Message Edited by altenbach on 03-15-2007 10:28 AM

Message 7 of 8
(15,323 Views)
thanks altenbach, works correctly and is more efficient than 2 times 90° rotation.

Could someone tell me if my code for rotating 90° is correct or if there is something more efficient to do?
0 Kudos
Message 8 of 8
(15,300 Views)