Support Center

the current image is not fitting to the ImageMan control

Basavsagar Aug 17, 2015 09:29AM EDT

we have a ImageMan control inside a VB .NET form , while using the scaling we specify the height and width of the current image same as that of the ImageMan control , but the image is getting cropped at right and bottom sides.

Here is the code snippet use:

Dim scale As New ScaleCommand

scale.Height = pobjImageControl.Height
scale.Width = pobjImageControl.Width
scale.ScaleOption = ScaleOptions.PreserveBlackPixels
pobjImageControl.Images.CurrentImage = scale.Process(pobjImageControl.Images.CurrentImage)

where pobjImageControl is our imageman control.
we are facing this issue for screens with resolution of 1280*1024

We also noted that Image man control's size and Image size are same after scale processing is executed.

As you suggested we tried setting the auto-scale mode property of the viewer control to 'Fit' but the image is still cropped from right and bottom side.

And we have the following doubt,
if the source imageman control is smaller and the destination imageman control(pobjImageControl as said above) is larger and we set the auto scale mode property of the destination control to Fit , does the image get stretched and Fit to destination control?

1 Data Techniques Response

Up 0 Rated Down
DTI Support  Data Techniques Employee Aug 17, 2015 09:43AM EDT


I would really suggest you use the AutoScaleMode property to scale the image. There are a variety of options you can set it to which are documented at

The Fit option will scale the image to fit into the control, the FitNoScaleUp will Fit the image to the control but will not display the image any larger than its actual size.

Thanks for your interest in our products and please let us know if you have any questions.

Data Techniques Support

This question is closed to new answers.

Contact Us