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 : Friday, August 5, 2005 6:26:29 AM(UTC)
alanskinner

Groups: Registered
Posts: 3



Hi I am trying to resize an animated GIF using the LATEST evaluation version but i get the error.
Normal GIFs work fine but animated GIFs cause an exception

InvalidParameter
Leadtools.RasterException: Invalid parameter passed
   at Leadtools.RasterException.CheckErrorCode(Int32 code)
   at Leadtools.ImageProcessing.RasterCommand.Run(IRasterImage image)


I am using the .NET API with this code...

                ResizeCommand resizeCommand = new ResizeCommand();

           
    RasterImage image = new RasterImage(Image.FromFile(@"c:\pen.gif"));
           
                resizeCommand.Flags = RasterSizeFlags.Normal;

           
    resizeCommand.DestinationImage = new RasterImage(    RasterMemoryFlags.Managed,

           
           
           
           
                    25,

           
           
           
           
                    25,

           
           
           
           
                    8,

           
           
           
           
                    RasterByteOrder.Rgb ,

           
           
           
           
                    RasterViewPerspective.TopLeft,

           
           
           
           
                    image.Palette,

           
           
           
           
                    null);
                resizeCommand.Run(image);

                Debug.WriteLine("Saving now");

           
    Image resizedImage = resizeCommand.DestinationImage.ConvertToGdiPlusImage();
                resizedImage.Save(@"C:\out.gif");
 

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 : Tuesday, August 9, 2005 2:32:29 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,328

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

Hello,

Try to use the following code to load an animated GIF file, resize it, and then save the result as animated gif file:
+---------------------------+
using Leadtools.ImageProcessing;
using Leadtools;
using Leadtools.Codecs;
...
private void button5_Click(object sender, System.EventArgs e)
{
int i =0;
IRasterImage image;           
RasterCodecs codecs = new RasterCodecs ();
ResizeCommand resizeCommand = new ResizeCommand();
image = codecs.Load(@"c:\qtrres.gif",0,CodecsLoadByteOrder.BgrOrGray,1,-1);
resizeCommand.Flags = RasterSizeFlags.Normal;
resizeCommand.DestinationImage = new RasterImage (RasterMemoryFlags.Managed , image.Width / 2, image.Height / 2, image.BitsPerPixel, image.Order , image.ViewPerspective, image.Palette , null );

for( i=1;i<image.PageCount;i++)
{
image.Page = i;
resizeCommand.Run(image);
codecs.Save(resizeCommand.DestinationImage,@"C:\out1.gif",RasterImageFormat.Gif,8,1,1,1,CodecsSavePageMode.Append  );
}
MessageBox.Show("Image Saved...");

}
+---------------------------+

Thanks,
Maen Badwan
LEADTOOLS Technical Support

 
#3 Posted : Tuesday, August 9, 2005 6:26:56 AM(UTC)
alanskinner

Groups: Registered
Posts: 3



Thanks I have kinda got this to work now but not quite!

if we base the resize on this image (hey its just the one i have been given!)

http://www.stereo-types.com/v/test2.gif

The LEAD tools is cropping the image!


The image in question has the charater in the middle with lots of white
space, after resizing the character has been resized but also the whitespace is gone and the character has been Stretched!!

also the delay has been change to SUPER_FAST? AND it doesnt open in many viewers, ie is ok though

Whats happened here?

my result of the code you gave me is here

http://www.stereo-types.com/v/test2result.gif

Please can we sort this ASAP as i am required to choose an image manipulation API for work ASAP also

Thanks alan.

 
#4 Posted : Thursday, August 11, 2005 12:08:16 PM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,328

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

Hello,

In the same code, if you try to use resizeCommand.Flags = RasterSizeFlags.Bicubic –Or- resizeCommand.Flags = RasterSizeFlags.Resample (instead of using resizeCommand.Flags = RasterSizeFlags.Normal), do you get the same results?

Thanks,
Maen Badwan
LEADTOOLS Technical Support

 
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-2020, Yet Another Forum.NET
This page was generated in 0.093 seconds.