I have a 1.6 megapixel camera and would like to display the camera images 1:1 in a display control (so without zooming, no scrollbars and so on). Ho do I go about this?
The first step to displaying your camera images 1:1 on the screen is to set the zoom state of the display control accordingly. By default, the Common Vision Blox display will zoom the images to fit into the display’s client area, preserving the image’s aspect ratio. If you want 1:1 (or 100%) zoom, the use code like the following to change the zoom state:
var w = Cvb.Image.ImageWidth(axCVDisp.Image);
var h = Cvb.Image.ImageHeight(axCVDisp.Image);
axCVDisp.SetDisplayZoom(w / 2, h / 2, 1);
This will set the zoom center to the middle of the image and the zoom factor to 100%.
If the display’s client area is not much bigger than the image you need to display, you might still see scroll bars in your UI. In that case, the following counter measures may help:
- Set the property
DisplayRectPercentage
to 100 - this will reduce the fringe area for display painting, freeing some space in the display’s client area for image pixels. - Set
BevelInner
andBevelOuter
tofalse
. This will free a few additional pixels for image display. - Consider emptying the status bar by setting
StatusCurrentPos
,StatusEmpty
,StatusGrayValue
,StatisImageSize
andStatusScale
tofalse
andStatusUserText
to an empty string. When empty, the status bar will automatically disappear, freeing a few additional pixels in the vertical direction. - Consider setting the
ScrollBars
property tofalse
. This will prevent the scroll bars from showing in the UI.
Hope that helps…