Re: 8 bit pixel in memory blits

"todd" <timza1221-/[email protected]>
Newsgroups gmane.comp.windows.wtl
Message-ID <[email protected]>
> StretchDIBits can do this without palettes if you specify DIB_RGB_COLORS and fill in the bmiColors array in the BITMAPINFO structure. The destination DC should contain a bitmap created with CreateDIBSection, again specifying DIB_RGB_COLORS and a valid bmiColors array.

What is bmiColors for, if not a palette?
That was probably my problem, but I did find out the amazing fact that the processor is so fast, that converting the 8-bit to 32 bit, doing the operation, and converting back to 8-bit, took a millisecond or less.  Amazing! I guess my bitmaps are not so big also. (maybe up to 500 on a side)
Thanks
Todd.





--- In [email protected], "Jim Barry" <j.barry@...> wrote:
>
> "todd" <timza1221@...> wrote:
> > Does anyone know if 8 bit per pixel StretchDIBits() blits can be done 
> > in-memory?
> > Is a palette required for the bitmaps and if so is SelectPalette() 
> > required?
> > Having trouble maintaining the 8-bit (gray scale) colors.
> 
> What exactly are you trying to do? Stretch an 8bpp DIB into another? 
> StretchDIBits can do this without palettes if you specify DIB_RGB_COLORS and 
> fill in the bmiColors array in the BITMAPINFO structure. The destination DC 
> should contain a bitmap created with CreateDIBSection, again specifying 
> DIB_RGB_COLORS and a valid bmiColors array.
> 
> You should call SetStretchBltMode(STRETCH_DELETESCANS) for the destination 
> DC - the default is STRETCH_ANDSCANS which causes strange results when 
> shrinking. Note that StretchDIBits is only capable of a very low-quality 
> "pixel resize". For anything better, e.g. interpolation or pixel averaging, 
> you'd need to use something other than StretchDIBits.
> 
> - Jim
>




------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/wtl/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/wtl/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.