Re: Saving a buffer as a bitmap?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



> Mike - thanks for the reply! Your code was one of the ways I tried,
> but failed.

Really? Hmm, that's odd. Did you take out the check for a DIB (the valid
data pointer?) If not then it will just exit right at the top even though
the rest of the code should cope with it properly (although it is untested.)
If this still doesn't work then let me know and I'll take a look at it.

> Will using a DIB instead of a DDB be identical, other than the BMP
> saving routine? The code draws on the buffer using mainly simple
> rectangles and text, and then it's bitblted to a preview window.

As far as your GDI drawing code is concerned, yes it will be exactly the
same however it will be stored independently of the display resolution. For
example if the user is running on an 8-bit display and you create a 24-bit
buffer you will get all the graphics processing done as a 24-bit buffer,
where as if you're using a DDB then it will all be converted to 8-bit (DDBs
are used for display use only.)
By the sounds of it your application is more suited to DIBSections if you're
writing the buffers to disk.
Hope this helps,

Mike


- Microsoft Visual Basic MVP -
E-Mail: EDais@xxxxxxxx
WWW: Http://EDais.mvps.org/


.



Relevant Pages

  • Re: VB MSCOMM RS232 communication and manipulation of data
    ... You may ignore my previous post as i have got the display of HEX data ... it may be the size of the buffer which i loop through is too ... Dim Temp1 As String ... I used the second method as above for displaying the hex data. ...
    (microsoft.public.vb.winapi)
  • Re: Parallax vision?
    ... One adapter is the dominant (obey your master, ... pre-written pages to display. ... the display buffer of the main adapter, it is the one which you assign ... The worker coprocessors know which range of the ...
    (comp.sys.ibm.ps2.hardware)
  • Re: Video memory and Splashscreen
    ... Does your display driver start? ... display buffer in a different place than the buffer that the display driver ... Bruce.Eitman AT EuroTech DOT com ... The Kernel Debugger is waiting to connect with target. ...
    (microsoft.public.windowsce.embedded)
  • Re: Directdraw back buffer issues
    ... gives me a pointer to one back buffer, what about the rest of them, ... Now I want to display this surface, but unfortunately I cannot set the ... primary surface to display it? ... pixel format of the primary surface to UYVY. ...
    (microsoft.public.win32.programmer.directx.graphics)
  • RE: Application Logging Block extending EIF asynchronous logging
    ... Thanks Mike for your timely response. ... > the event sink outputs the event to the outside transport (WMI, ... > The reason EIF was sync, was to avoid the issue of having to buffer events, ...
    (microsoft.public.vsnet.enterprise.tools)