By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,406 Members | 888 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,406 IT Pros & Developers. It's quick & easy.

Paint problem

P: n/a
I am using StretchDiBits to convert the DIB bitmap to Device context
of my window. It has some problem , sometimes it fails to paint the
form DC whenever i move the mouse over it get repainted. I even tried
using SetDIBitsToDevice , but it didn't help Is there i need to do ,
make this work , here is the code
ret=SetDIBitsToDevice(dc,mRect.left,mRect.Top,mWid th,mHeight,0,0,0,mHeight,pBits,bInfo,DIB_RGB_COLOR S);
Jul 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a

Hi Manjesh Gowda,

"Manjesh Gowda" <ma********@hotmail.com> schrieb im Newsbeitrag
news:e5**************************@posting.google.c om...
I am using StretchDiBits to convert the DIB bitmap to Device context
of my window. It has some problem , sometimes it fails to paint the
form DC whenever i move the mouse over it get repainted. I even tried
using SetDIBitsToDevice , but it didn't help Is there i need to do ,
make this work , here is the code

ret=SetDIBitsToDevice(dc,mRect.left,mRect.Top,mWid th,mHeight,0,0,0,mHeight,p
Bits,bInfo,DIB_RGB_COLORS);

You should probably post this in one of the Windows programming newsgroups.

But anyway, from what you're saying it seems you don't do the painting in
the WM_PAINT handling, as it should be. You should never draw to a window
outside WM_PAINT handling (between a BeginPaint() and EndPaint() bracket).
To trigger a window repaint, use InvalidateRect() with a RECT pointer of
NULL. The window receives a WM_PAINT message then when the system is ready
for it.

I hope this helps.

Regards,
Ekkehard Morgenstern.
Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.