Re: 8 bit pixel in memory blits

"Jim Barry" <[email protected]>
Newsgroups gmane.comp.windows.wtl
Message-ID <0FD77C7AA2E94150825452DB0C018771@jbarry>
"todd" <timza1221-/[email protected]> 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.