News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

RoundRect

Started by JayPee, October 14, 2010, 04:54:56 AM

Previous topic - Next topic

JayPee

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
Greetings From New Zealand
(Land of the Long White Cloud)

Farabi

Why not use the existing one? You can call roundrect on GDI library.
Those who had universe knowledges can control the world by a micro processor.
http://www.wix.com/farabio/firstpage

"Etos siperi elegi"

JayPee

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.
Greetings From New Zealand
(Land of the Long White Cloud)

sinsi

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."
Light travels faster than sound, that's why some people seem bright until you hear them.

Tedd

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
No snowflake in an avalanche feels responsible.

JayPee

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.

Greetings From New Zealand
(Land of the Long White Cloud)