LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Rotate image in CVI

Hi,

I need to rotate an image 90 degrees in CVI. I have a panel that
displays the image from a camera, but the camera is rotated 90 degrees
from horizontal. I would like to display the rotated image, and also
to save it.

I am currently trying to use FreeImage 3.8.0 but I am getting a number
of compile errors when trying to include the necessary files. The
project used Freeimage 2 previously, but the new version doesn't work
with my version of CVI (NI labwindows/CVI 6.0).

Some of the errors include -
wchar.h file isn't found
(133.18) Redeclaration of 'BOOL'
(671, 85) syntax error: found '*' expecting ')'

>From what I have read, Freeimage should still be compatible with C.
Any suggestions or maybe there is an easier way to rotate this image?

Thanks
~Chris H.

0 Kudos
Message 1 of 2
(4,157 Views)

Hi Chris,

in this thread you can find two sample projects for rotating bitmap images by 90°. Both of them are aimed to plot a text in vertical direction, but since they pass through bitmaps they can be used also for image treatment.

This is also the main disadvantage in this projects: they are customized to BMP format images. Bitmap images are basically a matrix or row by col pixels associated to their pixel depth, so they can be stored in an array and rotation is reduced to an appropriate rearrangement of elements in the array. Since you may need to use other types of images, to use those functions you should first load the image in a picture control and then get the bitmap of the control and rotate it, which may be an inefficient way of doing. Nevertheless, it may be useful to take a look to them.

Hope this helps

Roberto



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 2
(4,148 Views)