I'm using this code to draw a polygon shape with a border color and a fill color:
Now I want to change the code so only the border is drawn because there's something already plotted in the background that should not be overlapped. What kind of brush must I select, or what sort of nDrawMode in the SetROP2 function? (I've tried R2_MASKPEN but I don't like the resulting border)
VB Code:
Private Sub Polygon2Buffer(backbuffer As Long, border_color As Long, inner_color As Long) Dim mypoly() As POINTAPI Dim N As Long Dim hPen As Long Dim nDrawMode As Long Dim hOldPen As Long Dim hBrush As Long Dim hOldBrush As Long 'Polygon mypoly and the number of vertices N are 'calculated here (calculation is ommited) '... '... hBrush = CreateSolidBrush(inner_color) hOldBrush = SelectObject(backbuffer, hBrush) hPen = CreatePen(PS_SOLID, 2, border_color) hOldPen = SelectObject(backbuffer, hPen) nDrawMode = SetROP2(backbuffer, R2_COPYPEN) Polygon backbuffer, mypoly(0), N SetROP2 backbuffer, nDrawMode SelectObject backbuffer, hOldBrush SelectObject backbuffer, hOldPen DeleteObject hPen DeleteObject hBrush End Sub