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, August 1, 2006 3:17:23 PM(UTC)
David9908

Groups: Registered
Posts: 18


Hi Everyone,

I use LEAD Tools RasterView 14.5 make an image editor. The RasterIO.save have lots of parameters, but I think I just want to save the image back with the original format.

How could I get these parameters when I load the image and use them when I want to save back the image? Any sample codes?

David Liu

 

 

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 : Thursday, August 3, 2006 10:20:54 AM(UTC)

Otis  
Guest

Groups: Guests
Posts: 3,022

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

If you load the image from file, the IRasterImage.OriginalFormat Property will be updated with the files original format. Knowing this information, you know what format to save it back out as.

image = codecs.Load ("some file");
//Perform your processing
codecs.Save(image, "some file", image.OriginalFormat, image.BitsPerPixel);

 

 
#3 Posted : Thursday, August 3, 2006 10:30:20 AM(UTC)

Otis  
Guest

Groups: Guests
Posts: 3,022

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

I apologize, the code I gave you was for .NET, I did not notice you were using COM. If you are using COM, you can obtain the format of the file before you load it using the GetFileInfo method. This method will update the InfoFormat property which you can use when you save the file.

RasterIO.GetFileInfo raster, "some file", 0, 0
RasterIO.Load raster, "some file", 0, 0, 1
'Perform your processing
RasterIO.Save raster, "d:\temp\tmp.bmp", RasterIO.InfoFormat, raster.BitmapBits, 0, SAVE_OVERWRITE

 

 
#4 Posted : Friday, August 4, 2006 6:36:33 AM(UTC)
David9908

Groups: Registered
Posts: 18


Thank you. That is exactly what I want to know.
 
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.053 seconds.