IT Community - Software Programming, Web Development and Technical Support

Add Frame to a gif

This is a discussion on Add Frame to a gif within the C# Programming forums, part of the Software Development category; Hi,all. I want add some frames to a gif picture.But I didt fine any function to achieve it....


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > C# Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 02-24-2008, 07:20 PM
Savior Savior is offline
D-Web Trainee
 
Join Date: Feb 2008
Posts: 11
Savior is on a distinguished road
Unhappy Add Frame to a gif

Hi,all. I want add some frames to a gif picture.But I didt fine any function to achieve it.How can I do with a MagickNet?
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 02-24-2008, 10:36 PM
Anandavinayagam Anandavinayagam is offline
D-Web Sr.Programmer
 
Join Date: Mar 2007
Posts: 131
Anandavinayagam is on a distinguished road
Default Re: Add Frame to a gif ImageMagick

do you want to add frame like this

frame.jpg

?
__________________
The MOSS
Master of Solution Service

Last edited by Anandavinayagam : 02-26-2008 at 01:56 AM.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-24-2008, 11:30 PM
Savior Savior is offline
D-Web Trainee
 
Join Date: Feb 2008
Posts: 11
Savior is on a distinguished road
Default Re: Add Frame to a gif

Hi,Anandavinayagam.
png or jpg pictures.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-25-2008, 01:12 AM
Anandavinayagam Anandavinayagam is offline
D-Web Sr.Programmer
 
Join Date: Mar 2007
Posts: 131
Anandavinayagam is on a distinguished road
Default Re: Add Frame to a gif ImageMagick

Magick.Init();
MagickNet.Image img = new MagickNet.Image(@"D:\13_jpg1.jpg");
img.Border(new Geometry(10,10));
img.Write(@"d:\border-result.jpg");

Magick.Term();
__________________
The MOSS
Master of Solution Service

Last edited by Anandavinayagam : 02-26-2008 at 01:57 AM.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-25-2008, 01:33 AM
Savior Savior is offline
D-Web Trainee
 
Join Date: Feb 2008
Posts: 11
Savior is on a distinguished road
Default Re: Add Frame to a gif

Hi, I think there some misunderstanding here.
What I real want is a gif picture with animations.Just like a dog is running in the picture,and so on .Can you help me ?Thanks
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-25-2008, 06:33 AM
Anandavinayagam Anandavinayagam is offline
D-Web Sr.Programmer
 
Join Date: Mar 2007
Posts: 131
Anandavinayagam is on a distinguished road
Default Re: Add Frame to a gif ImageMagick

Magick.Init();

MagickNet.ImageList imglist = new MagickNet.ImageList();
imglist.Add(@"D:\1.jpg");
imglist.Add(@"D:\2.jpg");
imglist.Add(@"D:\3.jpg");
imglist.Add(@"D:\4.jpg");
imglist.Write("d:\\animated.gif");

Magick.Term();

I think this will help
__________________
The MOSS
Master of Solution Service

Last edited by Anandavinayagam : 02-26-2008 at 01:57 AM.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 02-25-2008, 06:44 AM
Anandavinayagam Anandavinayagam is offline
D-Web Sr.Programmer
 
Join Date: Mar 2007
Posts: 131
Anandavinayagam is on a distinguished road
Default Re: Add Frame to a gif ImageMagick

You can do the same animation with delay like this in ImageMagick


Quote:
Magick.Init();
MagickNet.Image im1 = new MagickNet.Image(@"D:\1.jpg");
MagickNet.Image im2 = new MagickNet.Image(@"D:\2.jpg");
MagickNet.Image im3 = new MagickNet.Image(@"D:\3.jpg");
im1.AnimationDelay = 200;
im2.AnimationDelay = 200;
im3.AnimationDelay = 200;
MagickNet.ImageList imglist = new MagickNet.ImageList();


imglist.Images.Add(im1);
imglist.Images.Add(im2);
imglist.Images.Add(im3);


imglist.Write("d:\\new-animated.gif");

Magick.Term();
__________________
The MOSS
Master of Solution Service

Last edited by Anandavinayagam : 02-26-2008 at 01:58 AM.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 02-25-2008, 06:07 PM
Savior Savior is offline
D-Web Trainee
 
Join Date: Feb 2008
Posts: 11
Savior is on a distinguished road
Default Re: Add Frame to a gif

Thanks very much! I test this code, and I find a bug here.
we can see as the picture in attachment.I use the pictures have been transparented by Transparent(). But we still can see the first picture presented under the second picture.How can I solve this bug?


Quote:
Originally Posted by Anandavinayagam View Post
You can do the same animation with delay like this
Attached Images
File Type: gif test.gif (6.0 KB, 7 views)
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 02-25-2008, 06:10 PM
Savior Savior is offline
D-Web Trainee
 
Join Date: Feb 2008
Posts: 11
Savior is on a distinguished road
Default Re: Add Frame to a gif

the attachment need to be saved to you pc to see how it animation works.....
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 02-25-2008, 09:24 PM
Anandavinayagam Anandavinayagam is offline
D-Web Sr.Programmer
 
Join Date: Mar 2007
Posts: 131
Anandavinayagam is on a distinguished road
Default Re: Add Frame to a gif

You can use the GifDisposeMethod to remove the frames..

DisposeType contains

BackgroundDispose
PreviousDispose
NoneDispose
UndefinedDispose
UnrecognizedDispose

You can test...and use ur required type


Quote:
im1.GifDisposeMethod = DisposeType.BackgroundDispose;
im2.AnimationDelay = 200;
im2.GifDisposeMethod = DisposeType.BackgroundDispose;
im3.AnimationDelay = 200;
im3.GifDisposeMethod = DisposeType.BackgroundDispose;
__________________
The MOSS
Master of Solution Service
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #11 (permalink)  
Old 02-25-2008, 10:37 PM
Savior Savior is offline
D-Web Trainee
 
Join Date: Feb 2008
Posts: 11
Savior is on a distinguished road
Default Re: Add Frame to a gif

Hi,Anandavinayagam. Thanks a lot!
I get the answer.
Best Regards~
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cross-Frame Scripting P.Sathiya PHP Programming 60 03-20-2008 04:09 AM
Frame works in php venkatbi PHP Programming 10 12-05-2007 04:00 AM
.How do I make a link or form in one frame update another frame? oxygen HTML, CSS and Javascript Coding Techniques 2 07-27-2007 04:02 AM
Goto the particular frame on Keystroke oxygen Flash Actionscript Programming 1 07-21-2007 02:45 AM
Frame works in ajax varghese HTML, CSS and Javascript Coding Techniques 1 07-17-2007 05:18 AM


All times are GMT -7. The time now is 02:27 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0