473,405 Members | 2,445 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

reading an animated gif ...

Hi there,

I'm trying to read an animated gif from a url (for a banner-rotator). The
code I have now, does read the gif (or jpg), but the result is that I only
get the first frame of the animated gif, AND at a much lower quality :-(

Important to note is that the image is read from a url (from a different
server), and thus NOT from the local disk.

Below is the code I use:

//col[0] = the redirect-url
//col[1] = the image-url

string url = col[1].ToString();
WebClient wc = new WebClient();
Stream st = wc.OpenRead(url);
Bitmap bm = new Bitmap(st);

try
{
HttpResponse response = HttpContext.Current.Response ;
response.ClearContent();
response.ContentType = "image/GIF";
bm.Save(response.OutputStream, ImageFormat.Gif);
}
catch (Exception j)
{
Response.Write(j.Message);
}
st.Close();

What am I doing wrong ? Where should I alter it?

Any help is highly appreciated !!!

Tx in advance.

Greetingz,
Koen Hoorelbeke
ab****@noemail.nospam

Nov 18 '05 #1
2 2239
Jos
Koen Hoorelbeke wrote:
Hi there,

I'm trying to read an animated gif from a url (for a banner-rotator).
The code I have now, does read the gif (or jpg), but the result is
that I only get the first frame of the animated gif, AND at a much
lower quality :-(

<snip>

GDI+ does not support animated gifs (yet). Neither does it support
transparent gifs.
I think that even in ASP.NET 2.0, animated gif support will still be
missing.

--

Jos
Nov 18 '05 #2
It must be possible though! I saw an article where they did it, but the big
difference was that they read the animated gif from disk, and not from a url
....

The article can be found at
http://authors.aspalliance.com/steve...splayimage.asp
In that article they make a clear distinction between the version that only
reads the first frame and the one that reads them all (as it should be).

I just can't figure out how I should change my code to make it work ...

Any help?

Greetingz,
Koen Hoorelbeke
ab****@noemail.nospam

"Jos" wrote:
Koen Hoorelbeke wrote:
Hi there,

I'm trying to read an animated gif from a url (for a banner-rotator).
The code I have now, does read the gif (or jpg), but the result is
that I only get the first frame of the animated gif, AND at a much
lower quality :-(

<snip>

GDI+ does not support animated gifs (yet). Neither does it support
transparent gifs.
I think that even in ASP.NET 2.0, animated gif support will still be
missing.

--

Jos

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: DOK | last post by:
I'm trying to create an eBay ad. So far, I've got the page the way I want it. However, the few animated gif's I have on the page display but are no longer animated. I can get it to work in...
9
by: John J. Hughes II | last post by:
Is it possible using Image or Bitmap to build and save an animated GIF file? I am not have a problem saving the GIF file just getting the frames added to it. I did find ImageAnimator but it only...
10
by: Liz | last post by:
All: Can anyone tell me why my animated GIF does not show up as animated when put into a pictureBox?? Thanks. Liz
4
by: Al_C | last post by:
It's not that I expected it to work, but can anyone explane why if I put an animated gif as the background image of a form it is no longer animated? Is there any way to actually do that? Thanks,...
7
by: Gary Kaucher | last post by:
At the top of the page on my website http://www.itemlook.com I have an animated gif called "eyeline.gif". It has worked fine in the past, but recently I am unable to get it to work using IE6. All...
4
by: Jeff | last post by:
Hi, I'd like to write Javascript that stops animated gifs from animating. On Firefox, at least, window.stop(); does the trick, although it stops everything on the page and is kind of...
7
by: Lemune | last post by:
Hi.. I am developing an application that connect to database on the other side of the net. And each time i want to connect to database and run some sql command, i want my user to know that there...
27
by: Phil | last post by:
I thought it would be nice to display some animated GIFs on some of my forms. I put a PictureBox control on a form, and loaded my GIF file in. It animates, but not properly. It seems very jerky and...
0
by: helraizer1 | last post by:
Hey, I have a PHP script that I made for an image based shoutbox with emoticons. The problem is that php GD doesn't support animated gifs, yet perl GD does. How would I make it so that I could...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.