Hatched Brushes + a Scrolling View = Wacky Lines
-
Hi, I've written a document-view-application which draws boxes with fillings. I draw the fillings using a CRect and filling that with a hatched brush (HS_BDIAGONAL, HS_CROSS and so forth).... All works well until I start scrolling. It looks as if the view just draws the part of the document in the view that was invisible, but became visible because of the scroll... It also looks as though the brush's origin just takes the first visible point to start drawing instead of really using the coordinates of the rect it fills (because the top part of the box was, at the time, outside the viewport)... This results into wacky lines like this picture: http://hioforum.ftn.hsbrabant.nl/data/wacky\_lines.jpg Any idea of how to fix this? I don't like rewriting to code to manually drawing the lines, but of course it is an option.... Structured programming vs. chaotic mind boggling
-
Hi, I've written a document-view-application which draws boxes with fillings. I draw the fillings using a CRect and filling that with a hatched brush (HS_BDIAGONAL, HS_CROSS and so forth).... All works well until I start scrolling. It looks as if the view just draws the part of the document in the view that was invisible, but became visible because of the scroll... It also looks as though the brush's origin just takes the first visible point to start drawing instead of really using the coordinates of the rect it fills (because the top part of the box was, at the time, outside the viewport)... This results into wacky lines like this picture: http://hioforum.ftn.hsbrabant.nl/data/wacky\_lines.jpg Any idea of how to fix this? I don't like rewriting to code to manually drawing the lines, but of course it is an option.... Structured programming vs. chaotic mind boggling
GDI is something I know close to zero about, but seems like
SetBrushOrgEx
is what you're looking for. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo