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 : Thursday, April 30, 2015 1:10:51 AM(UTC)

RoiB  
RoiB

Groups: Registered
Posts: 7


Hi,
I load a Gif image which has frames (animated GIF) by
RasterCodecs.Load method.
(Image's PageCount > 0)
1. How can I handle one of the frames?
2. Which property in RasterImage is represent the location of the speeific frame in relation to the whole frames? (ilke the (x,y) location)
Thanks
Roi
 

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, April 30, 2015 8:13:43 AM(UTC)

Aaron  
Aaron

Groups: Registered, Tech Support, Administrators
Posts: 71

Was thanked: 4 time(s) in 3 post(s)

While using the RasterCodecs.Load method to load a Gif image into RasterImage object you can then use the Page property of the RasterImage to select a particular frame in the gif: https://www.leadtools.co...ls.rasterimage~page.html
You can then perform the necessary operations on the frame that is selected. I believe this also answers your second question as to the property in RasterImage that represents the location of the specific frame in relation to the frame set as you can get the next or previous frame in the sequence by incrementing or decrementing your page number.
Sidenote: Since you are asking about GIF and changing pages, you might be interested in checking out our help file topic Implementing Animations as well. You can find it here: https://www.leadtools.co...plementinganimation.html
Aaron Brasington
Developer Support Engineer
LEAD Technologies, Inc.

LEAD Logo
 
#3 Posted : Sunday, May 3, 2015 12:10:42 AM(UTC)

RoiB  
RoiB

Groups: Registered
Posts: 7


The attached gif has 28 frames.
the first frame is the whole image and the others are small pictures of the progress bar's parts.
But when I see the AnimationOffset property, I see that all of the framse have the same value: {Point [x=0, y=0]}
Which propety I have to use?
RoiB attached the following image(s):
before.gif
 
#4 Posted : Tuesday, May 5, 2015 3:30:07 AM(UTC)

Aaron  
Aaron

Groups: Registered, Tech Support, Administrators
Posts: 71

Was thanked: 4 time(s) in 3 post(s)

I can see that maybe one of two things could be happening here:

1) You may not actually be loading every frame into the RasterImage because as of the current version of LEADTOOLS, RasterCodecs will only load the first image in an animated GIF image by default. Because of this, you have to specify to the RasterCodec that you want to load all frames by setting codecs.Options.Load.AllPages = true.

https://www.leadtools.com/help/leadtools/v19/dh/co/leadtools.codecs~leadtools.codecs.codecsloadoptions~allpages.html

2) You may not be changing the currently selected frame by setting image.Page equal to the corresponding frame you want to select.

https://www.leadtools.com/help/leadtools/v19/dh/l/leadtools~leadtools.rasterimage~page.html

The following code snippet is what I used to get the x and y offset of each frame in the GIF image:

RasterCodecs codecs = new RasterCodecs();
codecs.Options.Load.AllPages = true;
RasterImage image = codecs.Load("Replace with File Path to Image");
for(int i=1; i<=image.PageCount; i++)
{
image.Page = i;
Console.WriteLine(image.AnimationOffset);
}
Aaron Brasington
Developer Support Engineer
LEAD Technologies, Inc.

LEAD Logo
 
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.067 seconds.