Loading...

Scanned Image Truncation

Support for GdPicture Light Imaging Toolkit and GdPicture Pro Imaging ActiveX/SDK.

Scanned Image Truncation

Postby shauns » Thu May 31, 2007 12:19 pm

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
Quis custodiet ipsos custodes
shauns
 
Posts: 21
Joined: Fri May 25, 2007 3:43 pm
Location: North West England

Postby Loïc » Thu May 31, 2007 3:33 pm

Hi,

Could you post the code you are using to do that ?

Regards,

Loïc
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4437
Joined: Tue Oct 17, 2006 10:48 pm
Location: France

Postby shauns » Fri Jun 01, 2007 11:53 am

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
Quis custodiet ipsos custodes
shauns
 
Posts: 21
Joined: Fri May 25, 2007 3:43 pm
Location: North West England

Postby Loïc » Fri Jun 01, 2007 2:40 pm

Hi,

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:

http://www.gdpicture.com/references/gdp ... otate.html


Best regards,

Loïc Carrère
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4437
Joined: Tue Oct 17, 2006 10:48 pm
Location: France

Postby shauns » Fri Jun 01, 2007 3:02 pm

Hi,

When I tried that, the image size got smaller every time that I clicked on Rotate.

When I used the Rotate method I got a run time exception

regards

Shaun
Quis custodiet ipsos custodes
shauns
 
Posts: 21
Joined: Fri May 25, 2007 3:43 pm
Location: North West England

Postby Loïc » Mon Jun 04, 2007 3:30 pm

Hi,

When I tried that, the image size got smaller every time that I clicked on Rotate.


It is normal: When you are doing a rotation by angle the image must be enlarge to contains the full old image data...

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. http://www.gdpicture.com/ressources/betas/


Best regards,

Loïc
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4437
Joined: Tue Oct 17, 2006 10:48 pm
Location: France


Return to GdPicture [Pro] ActiveX

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

cron