hi, how can I generate a multiple-frame gif picture using gdi+

Win32 Programming

    Next

  • 1. GDI+ and loading PNG images from an IStream
    IImageBytes should not optional. If QI failes for IID_IImageBytes, decoding should be able to continue. Is this not the case? > ----- > I was using a custom istream that implemented IUnknown, ISequentialStream, > IStream. when loading the png, gdi+ was querying for a IImageBytes (defined > in GdiplusImaging.h). why does the png loader section of gdi+ use this, and > no other image loader ? ask MS :-) This posting is provided "AS IS" with no warranties, and confers no rights.
  • 2. Constructing Gdiplus::Font with HFONT
    For some reason this just isn't working for me. I can do the following just fine and see the string in the window: void CLUIImageTextOverlay::DrawOverlay( Graphics* g ) { // create brush SolidBrush* myBrush = new SolidBrush( Color( mAlpha, GetRValue(mColor), GetGValue(mColor), GetBValue(mColor))); // create font Gdiplus::Font font( "Arial", 12 ); // draw g->DrawString( mText, mText.Length(), &font, PointF(0, 0), (Brush*)myBrush ); } But, if I try and create a Font object using a HFONT, the string doesn't show up. I traced into DrawString and status is set to OK so I'm not quite sure what's going on. Here's the code: void CLUIImageTextOverlay::DrawOverlay( Graphics* g ) { // create brush SolidBrush* myBrush = new SolidBrush( Color( mAlpha, GetRValue(mColor), GetGValue(mColor), GetBValue(mColor))); // create font Gdiplus::Font font( g->GetHDC(), &mFont ); // draw g->DrawString( mText, mText.Length(), &font, PointF(0, 0), (Brush*)myBrush ); } Note that mFont in the Font constructor is an HFONT which is created in a call to: mFont = (HFONT) GetStockObject( DEFAULT_GUI_FONT ); Hope someone can help here. I'm pulling my hair out trying to figure it out. -Mark
  • 3. bitmap.MakeTransparent() OutOfMemory
    When ever I use this method I get an out of memory exception, it doesn't seem to matter what kind of image I use, large or small, i'm currently using a 100X100 image and it still runs out of memory, or well throws that exception Example // previous code defines Bitmap tr Color topLeft = b.GetPixel(5,5) b.MakeTransparent(topLeft) this.pictureBox1.Image = b catch(Exception ex MessageBox.Show(ex.ToString()) finall b.Dispose() I remember once reading that the OutOfMemory exception is a default for other exceptions, is that true I really hope someone can help me with this because I haven't made any headway on this issue in an age Many thanks (to all those great people who help me out, yah boo to the rest Jax

hi, how can I generate a multiple-frame gif picture using gdi+

Postby philip » Fri, 03 Sep 2004 10:01:03 GMT

hi,
    I have got the solution to extract each frame and its property from a
multiple-frame gif picture now.
    But how can I generate a multiple-frame gif picture with some images
using gdi+.
    Sample code is appreciated.

    thank you!



Re: hi, how can I generate a multiple-frame gif picture using gdi+

Postby Paul » Fri, 03 Sep 2004 11:47:04 GMT

On Thu, 2 Sep 2004 09:01:03 +0800, "philip" < XXXX@XXXXX.COM >





Here's an MS example of creating a multiframe image:
 http://www.**--****.com/ 

Re: hi, how can I generate a multiple-frame gif picture using gdi+

Postby philip » Sat, 04 Sep 2004 09:36:23 GMT

Thank you .
But the sample code you provided is to create tiff image, not gif image.
I once tried this sample code, the tiff image i created is only a container
for all image without animation.

So, do you have the sample code for creating "GIF" animation image.

Thank you again!

----- Original Message ----- 
From: "Paul" < XXXX@XXXXX.COM >
Newsgroups: microsoft.public.win32.programmer.gdi
Sent: Thursday, September 02, 2004 10:47 AM
Subject: Re: hi, how can I generate a multiple-frame gif picture using gdi+



 http://www.**--****.com/ 



Re: hi, how can I generate a multiple-frame gif picture using gdi+

Postby Paul » Sat, 04 Sep 2004 13:50:34 GMT

On Fri, 3 Sep 2004 08:36:23 +0800, "philip" < XXXX@XXXXX.COM >




Creating a multipage image is similar whether you're creating a TIFF
or GIF, which is why I linked the example.  When encoding specify
image/gif instead of image/tiff.  GIF also have a propertyitem
(PropertyTagFrameDelay) for each frame and a loop count for the entire
image.


Return to Win32 Programming

 

Who is online

Users browsing this forum: No registered users and 6 guest