I have no problem when zooming in on the image using the GetDisplayedArea and Crop and Resize methods but when I zoom out, GetDisplayedArea always returns 0 rather than go negative. and when you zoom out, using the mouse to pan the image does nothing when the image is smaller than the viewer.
Below is the code I use to resize the image from the viewer and save it when zoomed in.
Is there some way to save the image as displayed in the viewer when zoomed out?
thanks,
John
Code: Select all
Dim left as integer, top as integer, width as integer, height as integer
Dim MainImage As Integer = Imaging1.CreateGdPictureImageFromFile(gdViewer1.tag)
gdViewer1.GetDisplayedArea(Left, Top, Width, Height)
Imaging1.Crop(MainImage, Left, Top, Width, Height)
Imaging1.ResizeHeightRatio(MainImage, 2100, Drawing2D.InterpolationMode.HighQualityBicubic)
Imaging1.SaveAsJPEG(newimage, "C:\Temp\ImageTest.jpg")
Imaging1.ReleaseGdPictureImage(MainImage)