Date: Thu, 5 Feb 2004 00:56:31 +0700 From: Van Duc Uy Subject: Sorry:Re: [nanogui] Display Image with Microwindows Hello, Attached is diff files, i will add some more function about display "raw" image (captured from webcam). if everything well, i will give you the patch too. Regards, Michael On Tuesday 03 February 2004 12:34 pm, you wrote: > : Thank you very much, > : i can do it now > > Cool - please send me any source code changes so I can > add them to the core Microwindows code. > > Regards, > > Greg > > : On Thursday 05 February 2004 08:25 am, Greg Haerr wrote: > : > : I want to write a small program by microwindows (WIN32API) to display > : > : an > : > > : > image > : > > : > : from file (BMP,PNG,JPEG). > : > > : > The convbmp program converts a .bmp file into a C structure > : > (PMWIMAGEHDR) that is then used as a parameter to the > : > only win32 API for images (which is BTW non-standard): > : > DrawDIB(). > : > > : > The DRAWDIB function takes the MWIMAGEHDR struct > : > and draws an image. This was done some time ago since > : > I didn't have time to implement the whole win32 image > : > and bitmap functionality. > : > > : > If you take some of the file converter code in the Microwindows > : > engine level, engine/devimage.c, you will see that these routines > : > also decode both file and buffer streams into MWIMAGEHDR > : > structs. These routines start with LoadXXX, where XXX is > : > GIF, PNG, JPEG, BMP, etc. > : > > : > These above LoadXXX routines are currently static to > : > devimage.c, and are used by an engine routine, GdDrawImage(), > : > which draws an image. What you need to do is slightly hack > : > devimage.c to implement a GdLoadImage routine, which > : > just calls LoadXXX for the image and produces a returned > : > PMWIMAGEHDR structure pointer, which you then > : > can use the win32 API DrawDIB routine to draw. > : > > : > Regards, > : > > : > Greg > : > > : > > : > --------------------------------------------------------------------- > : > To unsubscribe, e-mail: nanogui-unsubscribe@linuxhacker.org > : > For additional commands, e-mail: nanogui-help@linuxhacker.org attachment; filename="devimage.c.diff" attachment; filename="device.h.diff"