Welcome Guest! To enable all features, please Login or Register.



Last Go to last post Unread Go to first unread post
#1 Posted : Friday, September 4, 2009 6:08:47 AM(UTC)

Groups: Registered
Posts: 7

For the record, I'm using:

Windows XP SP3
Visual Studio .NET Pro 2008
LEADTOOLS Imaging Pro 16 v16.081218.100600

I'm trying to incorporate animated gif display when using the LeadTools.WinForms.RasterImageList object.

To do this, when loading the images, I check the Image.PageCount property, and then, where necessary, create an instance of the following class, which will manage the animation of that particular item:

#Region "Class: Animated Gif Class"
Private Class AnimatedGif
Private _itm As Leadtools.WinForms.RasterImageListItem
Private WithEvents _timer As Timer

Public Sub New(ByVal itm As Leadtools.WinForms.RasterImageListItem)
_itm = itm

_timer = New Timer
_timer.Interval = _itm.Image.AnimationDelay
_timer.Enabled = True
End Sub

Private Sub _timer_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles _timer.Tick

If Not _itm Is Nothing Then
If Not _itm.Image Is Nothing Then
Dim i As Integer = _itm.Page
i = i + 1
If i > _itm.Image.PageCount Then i = 1

_itm.Page = i
_timer.Interval = _itm.Image.AnimationDelay

_timer.Enabled = False
End If
_timer.Enabled = False
End If
End Sub
End Class
#End Region

This is working just fine, with the exception of certain animated gifs that seem to have incrementally built frames.

Right now, at the timer_tick event, the picture updates to show the next frame in sequence.

I don't know much about animated gifs, so I'm looking for a sample that would allow me to play gifs with composite frames - I'm guessing where frame 1 stays put and the other frames animate on top of it...?

I have attached a sample gif file, where the frames have a backdrop of red. Playing this file in a regular graphics program you never see the red.

Any help would be appreciated.

MRTrevorF attached the following image(s):

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 : Friday, September 4, 2009 6:10:22 AM(UTC)

Groups: Registered
Posts: 7

Here are the first four frames, as shown using the LEADTOOLS for .NET VB Main Demo.
File Attachment(s):
screenshot.png (346kb) downloaded 37 time(s).
#3 Posted : Sunday, September 6, 2009 1:25:27 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

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

These are the actual contents of the image. However, the red pixels in the other frames are actually transparent, so when you play the animation in the image, they will not be seen.

To see how this is done, try the code sample in the Leadtools.RasterImageAnimator Class topic in our .NET help file.

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