473,387 Members | 1,606 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Paint problem

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
1 3658

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Rene | last post by:
Currently, the paint even will only acknowledge painting going on inside of the ClipRectangle, any of the drawing that is outside of the ClipRectangle is ignored. How can I get the paint...
0
by: vooose | last post by:
Consider a UserControl to which you do userControl.Paint += new PaintEventHandler(paint_method) If you don't like that way, and prefer to override onPaint( ) then the problem stated below...
3
by: Mike Cooper | last post by:
I have been staring at the above error for over a week now! I have a an inherited data class looking like thus: Public Class DataGridBoolColumnInherit Inherits...
7
by: Rotsey | last post by:
Hi, I have a interface that I use for a form so I can pass the form to another object. How do I add the Paint event to the interface and subsequently handle the paint event in my other...
5
by: =?Utf-8?B?SmVzcGVyLCBEZW5tYXJr?= | last post by:
Hi, On a usercontrol I've put a set of radiobuttons within a groupbox. These radiobuttons have visual style enables, i.e. they turn orange when hovering over them and green when pushed. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.