You cannot create a Graphics object from a GIF.
All new articles provide code in C# and VB.NET.
"George Nevsky" <apokriffree@hotbox.ru> wrote in message
news:e6%23IVqF6EHA.4040@TK2MSFTNGP14.phx.gbl...
> Ok. Thank you for this example but can you also help me with indexed color
> image?
> How to create Graphics object from GIF?
>
> "Bob Powell [MVP]" <bob@_spamkiller_bobpowell.net> wrote in message
> news:ehU4OpB6EHA.3856@tk2msftngp13.phx.gbl...
> > It's not the indexed image that you should use.
> >
> > Image i=Image.FromFile(<original>);
> > Bitmap bm=new Bitmap(thumbXsize, thumbYsize);
> > Graphics g=Graphics.FromImage(bm);
> > g.InterpolationMode=InterpolationMode.HighQualityBilinear;
> > g.DrawImage(i,new Rectangle(0,0,bm.Width,bm.Height),0,0,i.Width,
> > i.Height,GraphicsUnit.pixel);
> > g.Dispose();
> > i.Dispose();
> >
> > bm now holds a thumbnail image that you can save or display;
> > --
> > Bob Powell [MVP]
> > Visual C#, System.Drawing
> >
> > Find great Windows Forms articles in Windows Forms Tips and Tricks
> >
http://www.bobpowell.net/tipstricks.htm > >
> > Answer those GDI+ questions with the GDI+ FAQ
> >
http://www.bobpowell.net/faqmain.htm > >
> > All new articles provide code in C# and VB.NET.
> > Subscribe to the RSS feeds provided and never miss a new article.
> >
> >
> >
> >
> >
> > "George Nevsky" <apokriffree@hotbox.ru> wrote in message
> > news:%23iy686%235EHA.208@TK2MSFTNGP12.phx.gbl...
> >> But Graphics.FromImage doesn't work with indexed color pictures ...
> >>
> >>
> >> "Bob Powell [MVP]" <bob@_spamkiller_bobpowell.net> wrote in message
> >> news:OCu3TN35EHA.1564@TK2MSFTNGP09.phx.gbl...
> >> > Just create your thumbnail manually by creating an image the size of
> >> > the
> >> > desired thumbnail, obtaining a Graphics object from it using
> >> > Graphics.FromImage and drawing the original image to the thumbnail at
> > the
> >> > appropriate size.
> >> >
> >> > --
> >> > Bob Powell [MVP]
> >> > Visual C#, System.Drawing
> >> >
> >> > Find great Windows Forms articles in Windows Forms Tips and Tricks
> >> >
http://www.bobpowell.net/tipstricks.htm > >> >
> >> > Answer those GDI+ questions with the GDI+ FAQ
> >> >
http://www.bobpowell.net/faqmain.htm > >> >
> >> > All new articles provide code in C# and VB.NET.
> >> > Subscribe to the RSS feeds provided and never miss a new article.
> >> >
> >> >
> >> >
> >> >
> >> >
> >> > "George Nevsky" <apokriffree@hotbox.ru> wrote in message
> >> > news:ONYhvK35EHA.3124@TK2MSFTNGP11.phx.gbl...
> >> >> I wish to use GetThumbnailImage method of Image object to downsize
an
> >> > image
> >> >> but I don't want to use embedded thumbnail which can be in original
> > image
> >> >> file.
> >> >>
> >> >>
> >> >>
> >> >> I know probably it isn't best in the world way but I like it. It
works
> >> >> absolutely fine for my purposes. It is very simple. It works fine
with
> >> >> indexed color images like GIF as well as with true color images like
> >> >> JPEG.
> >> >> It is pretty fast. But it has one horrible thing. It is using
embedded
> >> >> thumbnail (if there is one) which can be ugly.
> >> >>
> >> >> How to tell to GDI+ don't use embedded thumbnail?
> >> >>
> >> >>
> >> >
> >> >
> >>
> >>
> >
> >
>
>