Rahmen mit abgerundeten ecken autoit

  • hallo liebes autoit Team

    Ich wollt mal fragen wie ich mit gdi plus einen rahmen bzw ein rechteck mit abgerundetem rahmen zeichnen kann

    am besten wäre es natürlich, wenn ich den rahmen bzw das rechteck mit einem semitransparentem hintergrund füllen könnet ca40% sichtbarkeit

  • Hast Glück!
    Ich hab die letztens erst benutzt und hatte sie deshalb schnell zur Hand:

    [autoit]

    Func _GDIPlus_GraphicsFillRoundRect($gra, $x, $y, $w, $h, $r = 30, $brush = 0)
    ;by TheShadowAE
    Local $path = _GDIPlus_PathCreate(1)
    _GDIPlus_PathAddPie($path, $x, $y, $r, $r, 180, 90)
    _GDIPlus_PathAddPie($path, $x + $w - $r, $y, $r, $r, 270, 90)
    _GDIPlus_PathAddPie($path, $x + $w - $r, $y + $h - $r, $r, $r, 0, 90)
    _GDIPlus_PathAddPie($path, $x, $y + $h - $r, $r, $r, 90, 90)
    _GDIPlus_PathAddRectangle($path, $x, $y + $r / 2, $w, $h - $r)
    _GDIPlus_PathAddRectangle($path, $x + $r / 2, $y, $w - $r, $h)
    _GDIPlus_PathCloseFigure($path)
    _GDIPlus_GraphicsFillPath($gra, $path, $brush)
    _GDIPlus_PathDispose($path)
    EndFunc ;==>_GDIPlus_GraphicsFillRoundRect

    [/autoit]

    Edit: Ach ja, die Funktion benutzt die GDIP.au3

    Dateien

    Spoiler anzeigen

    Grundkenntnisse in: C++, JavaScript
    Sehr gute Kenntnisse: PHP, JAVA, C und näturlich AutoIt


    Klaviatur, Anhang UDF, GDI+ Mühle

    Zitat

    "Wenn einen um 20h der Pizzadienst anruft und fragt, ob man's nur vergessen hat und ob man das gleiche
    möchte wie immer -- dann sollte man sein Bestellverhalten evtl überdenken"

  • Hi,

    oder einfacher:

    Spoiler anzeigen
    [autoit]


    Func CreateRoundRectRgn ($nLeftRect, $nTopRect, $nRightRect, $nBottomRect, $nWidthEllipse, $nHeightEllipse)

    [/autoit] [autoit][/autoit] [autoit]

    Local $aRes = DllCall ($gdi32dll, "HANDLE", "CreateRoundRectRgn", _
    "int", $nLeftRect, _ ; x-coordinate of upper-left corner
    "int", $nTopRect, _ ; y-coordinate of upper-left corner
    "int", $nRightRect, _ ; x-coordinate of lower-right corner
    "int", $nBottomRect, _ ; y-coordinate of lower-right corner
    "int", $nWidthEllipse, _ ; height of ellipse
    "int", $nHeightEllipse) ; width of ellipse
    Return $aRes[0]

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func FillRgn ($hdc, $hrgn, $hbr)

    [/autoit] [autoit][/autoit] [autoit]

    Local $aRes = DllCall ($gdi32dll, "BOOL", "FillRgn", _
    "HANDLE", $hdc, _ ; handle to device context
    "HANDLE", $hrgn, _ ; handle to region to be filled
    "HANDLE", $hbr) ; handle to brush used to fill the region
    Return $aRes[0]

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc

    [/autoit]