This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Tuesday, August 1, 2006 3:17:23 PM(UTC)
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
#2
Posted
:
Thursday, August 3, 2006 10:20:54 AM(UTC)
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)
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)
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.