LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Adding a resolution/zoom selector to a bmp image

Hi,
I'm trying to load a .bmp image on a panel by using SetCtrlBitmap(). I have used the "Size control to Image" option for the picture and added scrollbars to the panel.
However, the .bmp i'm loading is very large and I want the user to be able to select the image zoom in percentage
as seen in any image viewer.
Is this possible in labWindows or are there any ways around this?
All helps is apprciated!
0 Kudos
Message 1 of 2
(2,978 Views)
You can do the following:

1. Before displaying the control, load the image with the fit mode set to "Size control to image" the way you're already doing it.

2. Obtain the size (width and height) of the control. Those sizes will correspond to the 100% zoom of the image. (I'm assuming here that 100% means full size, and lower percentages mean that the image will be smaller and blurrier).

3. Change the fit mode to "Size image to control"

4. Before displaying the control, ask the user what percentage is desired. Once you have a percentage, resize the control accordingly from its original size to the size that is proportional to the percentage. You need to do this both vertically and horizontally.

5. Now display the panel.

Hope this helps.

Luis
NI
0 Kudos
Message 2 of 2
(2,962 Views)