Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

SelectClipRgn

rswy
Beginner
457 Views
I would like some help on how to use the SelectClipRgn function in my application.It basically involves drawing some curves on a static image(in a dialog box) and any part of the curve outside the static image should be clipped out and not displayed.I am using the Arc function to draw the curves.Any pointers?
-rswy
0 Kudos
1 Reply
Jugoslav_Dujic
Valued Contributor II
457 Views
Should be (untested):
integer:: hrgn
hrgn = CreateRectRgn(17, 42, 212, 197)
i = SelectClipRgn(hdc, hrgn)
i = DeleteObject(hrgn)
...do the drawing
i = SelectClipRgn(hdc, 0)
But, first, what do you refer to by "static image"? If it's a control (e.g. a static control), the output should be clipped automatically without need to call SelectClipRgn. If you're drawing directly onto dialog's hDC, I'd suggest drawing onto a static control instead. See the sample which comes with Xflogm -- it uses SS_OWNERDRAW static control and actually handles WM_DRAWITEM (see DLG_DRAWITEM under refernce).

Jugoslav
0 Kudos
Reply