Hi All
I would like to write a routine similar to the RoundRect function. I just require the rounded corner drawing function however not being into graphics I'm not sure where to start. If someone could point me in the right direction or has source it would be appreciated.
Thank you
John
Why not use the existing one? You can call roundrect on GDI library.
Quote from: Farabi on October 14, 2010, 05:38:39 AM
Why not use the existing one? You can call roundrect on GDI library.
Thanks for the reply
The reason I'm not using the existing one is I want to overlay a rounded rect over a graphic however when trying it with RoundRect it wiped the image and using a Transparent Brush didn't recover the image.
Have you tried CreatePatternBrush with the bitmap? Use SelectObject and then RoundRect - according to MSDN:
"The rectangle is outlined by using the current pen and filled by using the current brush."
The following works fine, you can still see the text, you just get the outline.
.IF (eax==WM_PAINT)
push ebx
invoke BeginPaint, hwnd,ADDR ps
mov ebx,eax ;hDC
invoke TextOut, ebx,20,20,ADDR test_str,SIZEOF test_str
invoke GetStockObject, HOLLOW_BRUSH
invoke SelectObject, ebx,eax
invoke RoundRect, ebx,5,5,100,60,12,12
invoke EndPaint, hwnd,ADDR ps
pop ebx
Hi Tedd
Thank you very much - that did the trick nicely.
I managed to come up with my own version without fill using the Arc Function - if anyone is interested I will post the code when I finish tidying it up.