Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs have moved to the Altera Community. Existing Intel Community members can sign in with their current credentials.

SelectClipRgn

rswy
Beginner
506 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
506 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