Scanned Image Truncation
Scanned Image Truncation
When I scan an A4 page and apply a rotation of 90 degrees to it in gdPicture Pro, the top and bottom of the document (that are now the sides) are cut off. It is like the original width of the document is used to clip it when displayed in gdViewer. Rotating through a further 90 degrees does not make the document whole again
I am using VS2003 C#. The gdViwer uses the same values as that in your VB6 sample RotateByAngle. That sample does not cause this problem
I am using VS2003 C#. The gdViwer uses the same values as that in your VB6 sample RotateByAngle. That sample does not cause this problem
Hi
This is the code I am using in the prototype. I am using setzoomfit
private bool RotateImage(int angle, int page)
{
int _imageSource = 0;
GdpicturePro.cGdPictureStatus _status;
_imageProcessor.SetNativeImage((int)_documentPage[page]);
_imageToRotate = (int)_documentPage[page];
_status = _imageProcessor.ConvertTo16Bpp();
_imageSource = _imageProcessor.GetNativeImage();
_imageProcessor.CloseImage(_imageToRotate);
_status = _imageProcessor.RotateAnglePreserveDimentionsCenter(angle);
_imageToRotate = _imageProcessor.GetNativeImage();
_imageProcessor.CloseImage(_imageSource);
_status = _imageProcessor.ConvertTo1BppFast();
_imageSource = _imageProcessor.GetNativeImage();
_imageProcessor.CloseImage(_imageToRotate);
_documentPage[page] = _imageSource;
imgViewer.DisplayFromImageRef(_imageSource);
return true;
}
regards
Shaun
This is the code I am using in the prototype. I am using setzoomfit
private bool RotateImage(int angle, int page)
{
int _imageSource = 0;
GdpicturePro.cGdPictureStatus _status;
_imageProcessor.SetNativeImage((int)_documentPage[page]);
_imageToRotate = (int)_documentPage[page];
_status = _imageProcessor.ConvertTo16Bpp();
_imageSource = _imageProcessor.GetNativeImage();
_imageProcessor.CloseImage(_imageToRotate);
_status = _imageProcessor.RotateAnglePreserveDimentionsCenter(angle);
_imageToRotate = _imageProcessor.GetNativeImage();
_imageProcessor.CloseImage(_imageSource);
_status = _imageProcessor.ConvertTo1BppFast();
_imageSource = _imageProcessor.GetNativeImage();
_imageProcessor.CloseImage(_imageToRotate);
_documentPage[page] = _imageSource;
imgViewer.DisplayFromImageRef(_imageSource);
return true;
}
regards
Shaun
Hi,
For your need you can replace this line of code
by this one:
The best way to make a 90° rotation is tu use the Rotate() method:
https://www.gdpicture.com/references/gdp ... otate.html
Best regards,
Loïc Carrère
For your need you can replace this line of code
Code: Select all
_status = _imageProcessor.RotateAnglePreserveDimentionsCenter(angle);
by this one:
Code: Select all
_status = _imageProcessor.RotateAngle(angle);
The best way to make a 90° rotation is tu use the Rotate() method:
https://www.gdpicture.com/references/gdp ... otate.html
Best regards,
Loïc Carrère
Hi,
One tip: make a clone of the original image each time you want to apply an angle rotation.
ex:
The last pre-release have this bug fixed. https://www.gdpicture.com/ressources/betas/
Best regards,
Loïc
It is normal: When you are doing a rotation by angle the image must be enlarge to contains the full old image data...When I tried that, the image size got smaller every time that I clicked on Rotate.
One tip: make a clone of the original image each time you want to apply an angle rotation.
ex:
Code: Select all
nOriginalImage = oGdPicture.GetNativeImage()
nRotatedImage = oGdPicture.CreateClonedImage(nOriginalImage)
oGdPicture.SetNativeImage (nRotatedImage)
nStat = oGdPicture.RotateAngler(nAngle)
When I used the Rotate method I got a run time exception
The last pre-release have this bug fixed. https://www.gdpicture.com/ressources/betas/
Best regards,
Loïc
Who is online
Users browsing this forum: No registered users and 1 guest