Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Tuesday, May 9, 2006 1:02:38 AM(UTC)
kalyanchakri

Groups: Registered
Posts: 13


Hi

i'm using the following code to rotate the image ..

Leadtools.ImageProcessing.RotateCommand _command = new Leadtools.ImageProcessing.RotateCommand();

_command.Angle = iAngle;

_command.FillColor = new Leadtools.RasterColor(System.Drawing.Color.White);

_command.Flags = Leadtools.ImageProcessing.RotateCommandFlags.Resize;

_command.Run(_viewer.Image);

 

but this code is rotating the current image which is in viewer ...

My requirement is i have to rotate all the pages and want to save the image ...

is there any other way to get my requrement ,

pls help me ,

bye.

kalyan

 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Wednesday, May 10, 2006 3:12:00 AM(UTC)

Amin  
Amin

Groups: Manager, Tech Support
Posts: 367

Was thanked: 1 time(s) in 1 post(s)

Kalyan,
You have to run the rotate command on each page separately. To do that, loop from 1 to _viewer.Image.PageCount, update the _viewer.Image.Page with the loop index value, and re-run the command inside the loop.

The help topic IRasterImage.PageCount Property contains a sample that uses one of the processing commands on all pages.

Amin Dodin

Senior Support Engineer
LEAD Technologies, Inc.
LEAD Logo
 
#3 Posted : Wednesday, May 10, 2006 4:50:34 AM(UTC)
kalyanchakri

Groups: Registered
Posts: 13


Hi Amin Dodin

Thnakyou verymuch for ur help in this , i have achived the rotate functionality for the all the pages ata time ,

i have another question regarding this , is it posible to save the multipage tiff documnetnt if one of the image is rotated ? if posible give the solution how to achive this ..

 

thanks

kalyan

 
#4 Posted : Sunday, May 14, 2006 9:18:37 AM(UTC)

Amin  
Amin

Groups: Manager, Tech Support
Posts: 367

Was thanked: 1 time(s) in 1 post(s)

Kalyan,
If you use the RasterCodecs.Save method with a RasterImage object after running any processing command, all images are saved in their current state after the processing you did.

This means if you rotated one or more pages, they will be saved in their new rotation position.
Amin Dodin

Senior Support Engineer
LEAD Technologies, Inc.
LEAD Logo
 
#5 Posted : Tuesday, June 13, 2006 5:07:34 AM(UTC)
kalyanchakri

Groups: Registered
Posts: 13


Hi,

 

i was successfully able to rotate and save the multipage tiff image ..but for every single rotation command the size of the documnet is doubling ...

How to restrict the size to be to the original ?

 
#6 Posted : Wednesday, June 14, 2006 5:29:14 AM(UTC)
kalyanchakri

Groups: Registered
Posts: 13


Hi,

thanks i was successfully able to rotate and save the multipage tiff image using RasterCodecs save method   ..but for every single rotation command the size of the documnet is increasing...if i rotate all the Images in a multi tiff file the size of the document is increasing nearly double to the orignal . Is there any way for not to change the image size ..?
 
#7 Posted : Wednesday, June 14, 2006 9:50:36 AM(UTC)
kalyanchakri

Groups: Registered
Posts: 13


Here is my code for rotating and saving of a multi page tiff document

Leadtools.ImageProcessing.RotateCommand _command = new Leadtools.ImageProcessing.RotateCommand();

_command.Angle = iAngle;

_command.FillColor = new Leadtools.RasterColor(System.Drawing.Color.White);

_command.Flags = Leadtools.ImageProcessing.RotateCommandFlags.Resize;

_command.Run(_viewer.Image);

RasterCodecs rasterCodecs = new RasterCodecs();

Leadtools.Codecs.CodecsImageInfo imageinfor = rasterCodecs.GetInformation("tmp.tif" ,true);

MessageBox.Show( imageinfor.Compression.ToString());

IRasterImage rasterTemp = _codecs.Load("tmp.tif");

_codecs.Save(_viewer.Image,"tmp.tif",RasterImageFormat.TifCcittGroup4,imageinfor.BitsPerPixel,rasterTemp.Page,rasterTemp.Page,1,CodecsSavePageMode.Replace);

 

after the End of the save the image Size is Getting double..

 

 

 
#8 Posted : Wednesday, June 14, 2006 1:59:50 PM(UTC)

Amin  
Amin

Groups: Manager, Tech Support
Posts: 367

Was thanked: 1 time(s) in 1 post(s)

Kalyan,
The following post gives an explanation why this happens, but the solution in case is slightly different:
http://support.leadtools.com/SupportPortal/cs/forums/5000/ShowPost.aspx#5000

In your case, you are loading all images and saving them back again. Using the Replace flag causes all modified images to be added to the file, which doubles its size.

The solution is to save all modified images into a NEW temporary TIFF file using the Append flag, then delete the original file when finished and rename the temp file to the original name.

Amin Dodin

Senior Support Engineer
LEAD Technologies, Inc.
LEAD Logo
 
#9 Posted : Thursday, June 15, 2006 4:26:06 AM(UTC)
kalyanchakri

Groups: Registered
Posts: 13


Thannks ,

this works ..i just deleted the original fine before calling the Codecs.Save () method with Append mode .

 

 

 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.089 seconds.