Question
|
| |
|
How can I make sure that may images are displayed in their original size (1:1) in the CVB Display?
|
|
Answer
|
| |
|
The zoom factor of the CVB display may be set to 1:1 using the method SetDisplayZoom. To avoid the display of scrollbars it is necessary to enlarge the display control to take up the whole of the image (if possible).
|
|
Visual Basic users need to take care of the correct conversion between pixels and display coordinates (which are measured in TWIPS):
|
|
|
Dim imx As Long
|
Dim imy As Long
|
Dim x As Long
|
Dim y As Long
|
Dim xpixel As Long
|
Dim ypixel As Long
|
|
x = cvImg.ImageHeight ' get height of the image
|
y = cvImg.ImageWidth ' get width of the image
|
|
xpixel = x * Screen.TwipsPerPixelX ' conversion from pixels to twips
|
ypixel = y * Screen.TwipsPerPixelY ' conversion from pixels to twips
|
|
|
Danach muss die neue Höhe und neue Breite des Displays gesetzt werden.
|
|
|
cvDisp.Height = xpixel + (30 * Screen.TwipsPerPixelX) 'set new display height
|
cvDisp.Width = ypixel + (30 * Screen.TwipsPerPixelY) 'set new display width
|
|
|
| The additional 30 pixels in the upper sample ensure that the borders and the status line of the CVB Displays are considered correctly. |