how to Improve DrawDIB's quality?
Posted
by sxingfeng
on Stack Overflow
See other posts from Stack Overflow
or by sxingfeng
Published on 2009-07-13T02:43:43Z
Indexed on
2010/04/04
15:33 UTC
Read the original article
Hit count: 203
I am coding in c++, gdi I use stretchDIBits to draw Images to dc.
::SetStretchBltMode(hDC, HALFTONE);
::StretchDIBits(
hDC,
des.left,des.top,des.right - des.left,des.bottom - des.top,
0, 0,
img.getWidth(),
img.getHeight(),
(img.accessPixels()),
(img.getInfo()),
DIB_RGB_COLORS,
SRCCOPY
);
However It is slow. So I changed to use DrawDib function.
::SetStretchBltMode(hDC, HALFTONE);
DrawDibDraw(
hdd,
hDC,
des.left,des.top,des.right - des.left,des.bottom - des.top,
(LPBITMAPINFOHEADER)(img.getInfo()),
(img.accessPixels()),
0, 0,
img.getWidth(),
img.getHeight(),
DDF_HALFTONE
);
However the result is just like draw by COLORONCOLOR Mode. How can I improve the drawing quality?
© Stack Overflow or respective owner