Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/22/2023 in all areas

  1. Something like this? #include <GDIPlus.au3> Global $iWidth = 200, $iHeight = 100, $iCornerRadius = 20 _GDIPlus_Startup() Local $hBitmap = _GDIPlus_BitmapCreateFromScan0($iWidth, $iHeight) Local $hGraphics = _GDIPlus_ImageGetGraphicsContext($hBitmap) Local $hFontFamily = _GDIPlus_FontFamilyCreate('Arial') Local $hFont = _GDIPlus_FontCreate($hFontFamily, 24) Local $tLayout = _GDIPlus_RectFCreate(0, 0, $iWidth, $iHeight) Local $hFormat = _GDIPlus_StringFormatCreate() Local $hBrush = _GDIPlus_BrushCreateSolid(0xFFFF0000) Local $hBrush2 = _GDIPlus_BrushCreateSolid(0xFF000080) _GDIPlus_StringFormatSetAlign($hFormat, 1) _GDIPlus_StringFormatSetLineAlign($hFormat, 1) ; UEZ - round corners ; https://www.autoitscript.com/forum/topic/188050-solved-gdi-rounded-corners-on-a-image/#comment-1350513 Local $hPath = _GDIPlus_PathCreate() _GDIPlus_PathAddArc($hPath, $iWidth - ($iCornerRadius * 2), 0, $iCornerRadius * 2, $iCornerRadius * 2, 270, 90) _GDIPlus_PathAddArc($hPath, $iWidth - ($iCornerRadius * 2), $iHeight - ($iCornerRadius * 2), $iCornerRadius * 2, $iCornerRadius * 2, 0, 90) _GDIPlus_PathAddArc($hPath, 0, $iHeight - ($iCornerRadius * 2), $iCornerRadius * 2, $iCornerRadius * 2, 90, 90) _GDIPlus_PathAddArc($hPath, 0, 0, $iCornerRadius * 2, $iCornerRadius * 2, 180, 90) _GDIPlus_PathCloseFigure($hPath) _GDIPlus_GraphicsFillPath($hGraphics, $hPath, $hBrush2) _GDIPlus_GraphicsDrawStringEx($hGraphics, 'Button', $hFont, $tLayout, $hFormat, $hBrush) _GDIPlus_ImageSaveToFile($hBitmap, @ScriptDir & '\output.png') _GDIPlus_PathDispose($hPath) _GDIPlus_BrushDispose($hBrush) _GDIPlus_BrushDispose($hBrush2) _GDIPlus_StringFormatDispose($hFormat) _GDIPlus_FontDispose($hFont) _GDIPlus_FontFamilyDispose($hFontFamily) _GDIPlus_GraphicsDispose($hGraphics) _GDIPlus_BitmapDispose($hBitmap) _GDIPlus_Shutdown()
    1 point
×
×
  • Create New...