Jump to content

Search the Community

Showing results for tags 'text transparent png'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. Ciao, I tried to write a text on a transparent png file, but I write text but without background. This is my script: #include <GDIPlus.au3> _GDIPlus_Startup() Global $circle_base = "circle.png" for $sString = 1 to 90 $hBrushNumber = _GDIPlus_BrushCreateSolid(0xFF014990) $hImagetemp = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\" & $circle_base) $iPenWidth = 0 $hPenNumber = _GDIPlus_PenCreate(0xFF014990, $iPenWidth) $hAttribute_Alpha = _GDIPlus_ImageAttributesCreate() $tColorMatrix = _GDIPlus_ColorMatrixCreateTranslate(0, 0, 0, 0) ;0 = opaque, -1 = transparent _GDIPlus_ImageAttributesSetColorMatrix($hAttribute_Alpha, 0, True, DllStructGetPtr($tColorMatrix)) $g_aDim = _GDIPlus_ImageGetDimension($hImagetemp) $g_hImage2 = _GDIPlus_BitmapCreateFromScan0($g_aDim[0], $g_aDim[1]) $g_hGfx = _GDIPlus_ImageGetGraphicsContext($g_hImage2) $hFamily = _GDIPlus_FontFamilyCreate("Uni Sans Heavy CAPS") ;Create font family object $hPath = _GDIPlus_PathCreate() ;Create new path object $tLayout = _GDIPlus_RectFCreate(0,0) ;Create string bounding rectangle X=0, Y=0 _GDIPlus_GraphicsSetSmoothingMode($g_hGfx, $GDIP_SMOOTHINGMODE_HIGHQUALITY) ;Sets the graphics object rendering quality (antialiasing) _GDIPlus_PathAddString($hPath, $sString, $tLayout, $hFamily, 0, 63, 0) ;Add the outline of the string to the path $aBounds = _GDIPlus_PathGetWorldBounds($hPath) ;Get bounding rectangle of the path X-Y-Width-Height $hMatrix = _GDIPlus_MatrixCreate() _GDIPlus_MatrixTranslate($hMatrix,(($g_aDim[0] - $aBounds[2])/2)-$aBounds[0], (($g_aDim[1] - $aBounds[3])/2)-$aBounds[1]) ;translate the matrix _GDIPlus_PathTransform($hPath, $hMatrix) ;apply the above transofrmation _GDIPlus_GraphicsDrawPath($g_hGfx, $hPath, $hPenNumber) ;Draw path to graphics handle _GDIPlus_GraphicsFillPath($g_hGfx, $hPath, $hBrushNumber) ;Fill path with solid color _GDIPlus_ImageSaveToFile($g_hImage2, @ScriptDir & "\numbers\"&$sString&".PNG") Next _GDIPlus_FontFamilyDispose($hFamily) _GDIPlus_BrushDispose($hBrushNumber) _GDIPlus_GraphicsDispose($g_hImage2) _GDIPlus_Shutdown() Thankyou Marco
×
×
  • Create New...