GDI Clipping

Started by
2 comments, last by giant 19 years, 11 months ago
Greeting. Hi, I was wondering if anyone could help me with this problem that I am having. I am writing a program and it uses GDI for all the Graphics. I am having a problem with the GDI shapes being rendered outside the area where they should be. I''ll try and explain. I have multiple classes which display data to the screen, (using GDI). These class Objects are positionable and can move. All this data, (position, size etc...) is stored within the class and is invisable to main. When the class render''s the data, it draws out everything that it has. I dont want this. I only want it to render the information if it apprears within the area that the class has specified in the combination of its size and position variables eg. PositionX = 10 and PositionY = 50 Width = 100 and Height = 80 Data is only rendered to screen if 10 > PixelX < 110 and 50 > PixelY < 130 I have tried using InvalidateRect and passing a RECT to it specifying where it can update, but this isnt working for me, its just acting really weird. Is there any way of setting up a clipper which I can specify on the fly inside the Render Function of the Object, ( The Objects Render Function is called within the WM_PAINT message, ie. after a call to InvalidateRect ) to use with GDI Functions such as Rectangle, LineTo, Polygon etc.... Any help is greatly apprecitated. Thanks Ciaran
Advertisement
Should that be 10 < pixelX < 110 ?
Yes it should!!!!
GDI Clipping Functions

[edited by - Anon Mike on May 27, 2004 8:00:29 PM]
-Mike

This topic is closed to new replies.

Advertisement