Could you tell me in human terms what we are talking about when we refer to a device context/display context.
Thanks
Printable View
Could you tell me in human terms what we are talking about when we refer to a device context/display context.
Thanks
HDC handleDeviceContext;
PAINTSTRUCT PaintSt;
handleDeviceContext= BeginPaint(hWnd, &PaintSt);
"HDC handleDeviceContext;" - Here we are creating a variable which will be a handle to a device context.
"PAINTSTRUCT PaintSt;" - Not 100% sure what is stored in here?
"handleDeviceContext= BeginPaint(hWnd, &PaintSt);" - This is where the device context actually comes from. This function returns a device context.
So a device context is just a virtual area which we use to paint graphical output.
Am i right in the above statements?
Ive got the feeling im not quite right here, but thats why you nice people are willing to clear things up, i hope :)
Just look at MSDN as to what BeginPaint() does.
Yes. In addition, see functions such as GetDeviceCaps() as an example. It takes a device context, and returns, given what you're asking for, information on that device context.Quote:
So a device context is just a virtual area which we use to paint graphical output.
http://msdn.microsoft.com/en-us/libr...=vs.85%29.aspx
Regards,
Paul McKenzie
Some years ago 2 guys created a revolution on the internet. It has to do with searching... they called themselves google. Learn to use it.Quote:
"PAINTSTRUCT PaintSt;" - Not 100% sure what is stored in here?
PAINTSTRUCT
One additional link http://msdn.microsoft.com/en-us/library/azz5wt61.aspx.
Seeing as we dont modify the attributes of the PAINTSTRUCT variable, the must be default values. By default does this make the device context area the size of the whole client area?
(This question is targeted at the rcPaint attribute of the structure)