This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Tuesday, April 1, 2008 7:02:12 AM(UTC)
Groups: Registered
Posts: 2
Hello,
I'm using Leadtools raster pro v15 with .NET, and my question is quite simple:
How can I keep the png transparency by doing these actions :
_ Load a PNG file (32bits) containing transparency
_ Resize this RasterImage ( Bicubic or whatever )
_ Save the RasterImage as PNG
At the end I would like to get my resized PNG with its transparency keeped.
Thanks in advance.
#2
Posted
:
Wednesday, April 2, 2008 5:26:32 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
When an image that contains transparency is saved as PNG,
the transparency information is saved automatically.
To do that use:
RasterCodecs.Load
ImageProcessing.Size
RasterCodecs.Save
#3
Posted
:
Wednesday, April 2, 2008 6:27:00 AM(UTC)
Groups: Registered
Posts: 2
Thanks for your help it works fine.
Here is my code sample for people who wants to have it in details :
RasterCodecs codecs = new RasterCodecs();
RasterImage img = codecs.Load(@"D:\TestImage.png");
SizeCommand command = new SizeCommand();
command.Width = 128;
command.Height = 128;
command.Flags = RasterSizeFlags.Resample;
command.Run(img);
codecs.Save(img, @"D:\TestImageResult.png", RasterImageFormat.Png, 32);
Have fun !
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.