Jump to content

AutoIt Watermark Image v0.89 beta build 2014-08-25


UEZ
 Share

Recommended Posts

Quote

Thanks for fixing the sticky buttons.

Someone (the one posting 4839 pixel high topics) gave me the idea of a replication wizard: give optionbox to apply the position in a grid of N*N multiplications, from current position, with offset Z*Z. Could not be too hard to make.

You mean davidkim ;) I don't know what you mean exactly! What is the purpose of this suggestion?

UEZ

I not written question.... :idea:

I interest am many quite in AutoitScript.From that is [http://cafe.naver.com/autoitscript[/color]] Korea of cafe(blog) to be operating, [size="2"][color="#ff00ff"]English cannot well[/size].Many help it requests.To read, it stands it thanks.

Link to comment
Share on other sites

Yes I know davidkim, he means with "Someone (the one posting 4839 pixel high topics)..." you. -> 네,이 davidkim을 알고, 그는과 의미 "(4839 픽셀 높은 주제를 게시 한) 사람이 ..." 너.

Btw, I updated the code to v0.77 beta build 2012-11-26.

Br,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

Someone (the one posting 4839 pixel high topics)

Yep you :) Next time, you know how to make spoiler and/or enclose in autoit tag.

gave me the idea of a replication wizard: give optionbox to apply the position in a grid of N*N multiplications, from current position, with offset Z*Z. Could not be too hard to make.

I don't know what you mean exactly! What is the purpose of this suggestion?

Purpose: like you asked yourself: what if I have a small "star" or similar I would like to repeat as a stamp all over.

Ex: start at 10,10, repeat in a matrix of 10 hor, 20 ver, offset each at 12px hor. 15 px ver.

I COULD do that manually but risk of errors is great.

It would be trivial to build this into "apply" button knowing

  • Content (this is current watermark text / image)
  • Offset position (current position), assuming array starting always top-left
  • Matrix size (like table size in MSWord)
  • Offset x and y (like table/row size in MSWord)
Of course the de-luxe version would be a visual indication of this, but an automated version would also be good.

Hope this clarifies my idea. Which is only an idea...

I am just a hobby programmer, and nothing great to publish right now.

Link to comment
Share on other sites

Ok, I think I got you now. The fill option is "very" simple and handled by a GDI+ function. Unfortunately you cannot tell that function to use any x/y offset setting to position each stamp image but I've an idea how to implement it.

Br,

UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

Is an UNDO function possible somewhere ? As far as I am aware, APPLY copies the work image onto the canvas image, and does not allow to reverse that ?

The "Doh, reload time" part has hit me a few times.

I am just a hobby programmer, and nothing great to publish right now.

Link to comment
Share on other sites

Undo is implemented now.

The "Doh, reload time" part has hit me a few times.

What do you mean with reload time?

Br,

UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

What do you mean with reload time?

Or better put "time to reload". Without undo, the only way to cancel out unwanted changes is to load original file again.

Perfect that undo is there now also.

I am just a hobby programmer, and nothing great to publish right now.

Link to comment
Share on other sites

I found one bug for WinXP users: when you reload an image the script crashes and the 2nd bug is, which was found by Torni, many thx, when you rotate the text on the left upper corner partly off the screen and move the text afterwards with the sliders, the text is cut off (technically it is not a bug).

Will be fixed in the next release hopefully.

Probably there are more bugs ...

Br,

UEZ

Edit: uploaded a new version

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

Yes I know davidkim, he means with "Someone (the one posting 4839 pixel high topics)..." you. -> 네,이 davidkim을 알고, 그는과 의미 "(4839 픽셀 높은 주제를 게시 한) 사람이 ..." 너.

Btw, I updated the code to v0.77 beta build 2012-11-26.

Br,

UEZ

Thank's UEZ :graduated:

I interest am many quite in AutoitScript.From that is [http://cafe.naver.com/autoitscript[/color]] Korea of cafe(blog) to be operating, [size="2"][color="#ff00ff"]English cannot well[/size].Many help it requests.To read, it stands it thanks.

Link to comment
Share on other sites

I found one bug for WinXP users: when you reload an image the script crashes and the 2nd bug is, which was found by Torni, many thx, when you rotate the text on the left upper corner partly off the screen and move the text afterwards with the sliders, the text is cut off (technically it is not a bug).

Will be fixed in the next release hopefully.

Probably there are more bugs ...

Br,

UEZ

Edit: uploaded a new version

My new question...

Characters or Picture move the ..

Possible with the mouse and drag to move?

view bottom samples...

Posted Image

Posted Image

I interest am many quite in AutoitScript.From that is [http://cafe.naver.com/autoitscript[/color]] Korea of cafe(blog) to be operating, [size="2"][color="#ff00ff"]English cannot well[/size].Many help it requests.To read, it stands it thanks.

Link to comment
Share on other sites

Sure, then I don't need to reinvent the wheel again.

I totally forgot the resizing request... :whistle:

Br,

UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

@davidkim: implemented. Please test.

Br,

UEZ

mouse drag movement text/image source is ???

$aMPos=GUIGetCursorInfo($hGUI_WM)

If$aMPos[4]=$idPicPreview_WMAndTimerDiff($t)>500Then

If$aMPos[2]Then

IfNot$iAdjX_WMAndNot$iAdjY_WMThen

$iMemX=0

$iMemY=0

EndIf

$iAdjX_WM=$aMPos[0]-$iOPosX+$iMemX

$iAdjY_WM=$aMPos[1]-$iOPosY+$iMemY

GUICtrlSetData($idSliderAdjX_WM,$iAdjX_WM)

GUICtrlSetData($idSliderAdjY_WM,$iAdjY_WM)

$bUpdate_WM=True

Else

IfNot$b1stRunThen

$iOPosX=$aMPos[0]

$iOPosY=$aMPos[1]

$iMemX=$iAdjX_WM

$iMemY=$iAdjY_WM

EndIf

EndIf

EndIf

If$bUpdate_WMThen

UpdatePreview_WM()

$bUpdate_WM=False

EndIf

I interest am many quite in AutoitScript.From that is [http://cafe.naver.com/autoitscript[/color]] Korea of cafe(blog) to be operating, [size="2"][color="#ff00ff"]English cannot well[/size].Many help it requests.To read, it stands it thanks.

Link to comment
Share on other sites

@davidkim: it makes sense to open a new topic in Graphical User Interface (GUI) Help and Support section with your issue. Otherwise this will mix up topic related content!

Br,

UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

@davidkim: it makes sense to open a new topic in Graphical User Interface (GUI) Help and Support section with your issue. Otherwise this will mix up topic related content!

Br,

UEZ

post moved...

thank's UEZ.

I interest am many quite in AutoitScript.From that is [http://cafe.naver.com/autoitscript[/color]] Korea of cafe(blog) to be operating, [size="2"][color="#ff00ff"]English cannot well[/size].Many help it requests.To read, it stands it thanks.

Link to comment
Share on other sites

  • 2 weeks later...

Update to AutoIt Watermark Image v0.85 beta build 2012-12-12.

For more information have a look to the 1st post.

Br,

UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 months later...

hi,

how can i add a small picture watermark in corner to a simple screenshot script? like this.

and possible to do when i press again the screenshot its count the pictures, screenshot01, screenshot02 etc.. ??

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <GDIPlus.au3>
#include <ScreenCapture.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Screenshot", 180, 146, 232, 134)
$Group1 = GUICtrlCreateGroup("Screenshot", 16, 8, 145, 121)
$Label1 = GUICtrlCreateLabel("Hotkey - F10", 56, 48, 65, 17)
$exit = GUICtrlCreateButton("Exit", 48, 80, 75, 25)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

HotKeySet("{F10}", "screenshot")


While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $exit
Exit
Func screenshot()
Opt("MustDeclareVars", 1)

; ===============================================================================================================================
; Description ...: Shows how to emboss text on an image
; Author ........: Paul Campbell (PaulIA)
; Notes .........:
; ===============================================================================================================================

; ===============================================================================================================================
; Global variables
; ===============================================================================================================================
Global $hBitmap, $hImage, $hGraphic, $hFamily, $hFont, $tLayout, $hFormat, $aInfo, $hBrush1, $hBrush2, $iWidth, $iHeight, $hPen
;Global $sString="  ###   Created by www.minisha.atw.hu   ###  "
Global $sString= @ScriptDir & "\MBoxSkin.png"

; ===============================================================================================================================
; Main
; ===============================================================================================================================

; Initialize GDI+ library
_GDIPlus_StartUp()

; Capture screen
$hBitmap  = _ScreenCapture_Capture(@MyDocumentsDir & '\screenshot00.jpg')

; Load image and emboss text
$hImage   = _GDIPlus_ImageLoadFromFile(@MyDocumentsDir & '\screenshot00.jpg')
$hGraphic = _GDIPlus_ImageGetGraphicsContext($hImage)
$hFamily  = _GDIPlus_FontFamilyCreate("Arial")
$hFont    = _GDIPlus_FontCreate($hFamily, 16, 1)
$tLayout  = _GDIPlus_RectFCreate(0, 0)
$hFormat  = _GDIPlus_StringFormatCreate(2)
$hBrush1  = _GDIPlus_BrushCreateSolid(0xA2FFFFFF)
$hBrush2  = _GDIPlus_BrushCreateSolid(0xC4FF0000)
$hPen     = _GDIPlus_PenCreate(0xC4000000, 2)
$aInfo    = _GDIPlus_GraphicsMeasureString($hGraphic, $sString, $hFont, $tLayout, $hFormat)
$iWidth   = DllStructGetData($aInfo[0], "Width" )
$iHeight  = DllStructGetData($aInfo[0], "Height")

_GDIPlus_GraphicsFillRect($hGraphic, 0, 0, $iWidth, $iHeight, $hBrush1)
_GDIPlus_GraphicsDrawRect($hGraphic, 1, 1, $iWidth, $iHeight, $hPen   )
_GDIPlus_GraphicsDrawStringEx($hGraphic, $sString, $hFont, $aInfo[0], $hFormat, $hBrush2)

; Save image
_GDIPlus_ImageSaveToFile($hImage, @DesktopCommonDir & '\screenshot01.jpg')

; Free resources
_GDIPlus_PenDispose         ($hPen    )
_GDIPlus_BrushDispose       ($hBrush1 )
_GDIPlus_BrushDispose       ($hBrush2 )
_GDIPlus_StringFormatDispose($hFormat )
_GDIPlus_FontDispose        ($hFont   )
_GDIPlus_FontFamilyDispose  ($hFamily )
_GDIPlus_GraphicsDispose    ($hGraphic)
_GDIPlus_ImageDispose       ($hImage  )
_GDIPlus_ShutDown()

; Show image
;Run("MSPaint.exe " & '"' & @DesktopCommonDir & '\screenshot01.jpg"')
EndFunc
EndSwitch
WEnd
Link to comment
Share on other sites

Try this:

#include <GUIConstantsEx.au3>
#include <ScreenCapture.au3>

Global Const $tagGDIPCOLORMATRIX = "float m[25];"

#region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Screenshot", 180, 146, 232, 134)
$Group1 = GUICtrlCreateGroup("Screenshot", 16, 8, 145, 121)
$Label1 = GUICtrlCreateLabel("Hotkey - F10", 56, 48, 65, 17)
$exit = GUICtrlCreateButton("Exit", 48, 80, 75, 25)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###

; Initialize GDI+ library
_GDIPlus_Startup()

HotKeySet("{F10}", "screenshot")


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE, $exit
            _GDIPlus_Shutdown()
            Exit
    EndSwitch
WEnd

Func screenshot()
    Local $hHBitmap, $hBitmap, $hBitmapStamp
    Local Static $iCounter = 0
    ; Capture screen
    $hHBitmap = _ScreenCapture_Capture()
    $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hHBitmap)
    _WinAPI_DeleteObject($hHBitmap)
    $hBitmapStamp = _GDIPlus_BitmapCreateFromFile("c:\Program Files (x86)\AutoIt3\Examples\GUI\logo4.gif") ; <<<<<<<<<<<< change this
    _GDIPlus_StampImage($hBitmap, $hBitmapStamp)
    ; Save image
    _GDIPlus_ImageSaveToFile($hBitmap, @ScriptDir & "\Screenshoot" & StringFormat("%02d", $iCounter) & ".jpg")
    _GDIPlus_BitmapDispose($hBitmap)
    _GDIPlus_BitmapDispose($hBitmapStamp)
    $iCounter += 1
EndFunc ;==>screenshot

Func _GDIPlus_StampImage(ByRef $hBmp, $hBmp_Stamp, $iPos = 1, $iRotation_WM = 100, $fAlpha = 0.75, $iAdjX = 0, $iAdjY = 0, $bFill = False, $iMinW = 8, $iMinH = 8)
    If $fAlpha < 0 Then $fAlpha = 0
    If $fAlpha > 1 Then $fAlpha = 1
    Local $iW = _GDIPlus_ImageGetWidth($hBmp), $iH = _GDIPlus_ImageGetHeight($hBmp)

    Local $hCtxt_Stamp = _GDIPlus_ImageGetGraphicsContext($hBmp)
    DllCall($ghGDIPDll, "uint", "GdipSetInterpolationMode", "handle", $hCtxt_Stamp, "int", 7)
    Local $iW_Stamp = _GDIPlus_ImageGetWidth($hBmp_Stamp), $iH_Stamp = _GDIPlus_ImageGetHeight($hBmp_Stamp)
    Local $hAttribute_Alpha = _GDIPlus_ImageAttributesCreate()
    Local $tColorMatrix = _GDIPlus_ColorMatrixCreateTranslate(0, 0, 0, -(1 - $fAlpha))
    Local $pColorMatrix = DllStructGetPtr($tColorMatrix)
    _GDIPlus_ImageAttributesSetColorMatrix($hAttribute_Alpha, 0, True, $pColorMatrix)
    Local $fSize = $iRotation_WM / 100, $hBrush_Fill
    If $bFill Then
        Local $hBmp_Fill = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromScan0", "int", $iW, "int", $iH, "int", 0, "int", 0x0026200A, "ptr", 0, "int*", 0)
        $hBmp_Fill = $hBmp_Fill[6]
        Local $hCtxt_Fill = _GDIPlus_ImageGetGraphicsContext($hBmp_Fill)
        If $fSize <> 1.00 Then
            Local $iWn = Int($iW_Stamp * $fSize), $iHn = Int($iH_Stamp * $fSize)
            Local $hBmp_tmp = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromScan0", "int", $iWn, "int", $iHn, "int", 0, "int", 0x0026200A, "ptr", 0, "int*", 0)
            $hBmp_tmp = $hBmp_tmp[6]
            Local $hCtxt_tmp = _GDIPlus_ImageGetGraphicsContext($hBmp_tmp)
            DllCall($ghGDIPDll, "uint", "GdipSetInterpolationMode", "handle", $hCtxt_tmp, "int", 7)
            _GDIPlus_GraphicsDrawImageRect($hCtxt_tmp, $hBmp_Stamp, 0, 0, $iWn, $iHn)
            $hBrush_Fill = DllCall($ghGDIPDll, "uint", "GdipCreateTexture", "ptr", $hBmp_tmp, "int", 0, "int*", 0)
            $hBrush_Fill = $hBrush_Fill[3]
            _GDIPlus_BitmapDispose($hBmp_tmp)
            _GDIPlus_GraphicsDispose($hCtxt_tmp)
        Else
            $hBrush_Fill = DllCall($ghGDIPDll, "uint", "GdipCreateTexture", "ptr", $hBmp_Stamp, "int", 0, "int*", 0)
            $hBrush_Fill = $hBrush_Fill[3]
        EndIf
        _GDIPlus_GraphicsFillRect($hCtxt_Fill, 0, 0, $iW, $iH, $hBrush_Fill)
        _GDIPlus_GraphicsDrawImageRectRectIA($hCtxt_Stamp, $hBmp_Fill, 0, 0, $iW, $iH, $iAdjX, $iAdjY, $iW, $iH, $hAttribute_Alpha)
        _GDIPlus_BrushDispose($hBrush_Fill)
        _GDIPlus_GraphicsDispose($hCtxt_Fill)
        _GDIPlus_BitmapDispose($hBmp_Fill)
    Else
        Local $iX, $iY, $fW = $iW_Stamp * $fSize, $fH = $iH_Stamp * $fSize, $fX = 0, $fY = 0
        Switch $iPos
            Case 1
                $iX = Min($iMinW, $iW)
                $iY = Min($iMinH, $iH)
            Case 2
                $iX = Abs(($iW - $iW_Stamp) / 2)
                $iY = Min($iMinH, $iH)
                $fX = ($iW_Stamp - $iW_Stamp * $fSize) / 2
            Case 3
                $iX = Abs($iW - $iW_Stamp - Min($iMinW, $iW))
                $iY = Min($iMinH, $iH)
                $fX = ($iW_Stamp - $iW_Stamp * $fSize)
            Case 4
                $iX = Min($iMinW, $iW)
                $iY = Abs(($iH - $iH_Stamp) / 2)
                $fY = ($iH_Stamp - $iH_Stamp * $fSize) / 2
            Case 5
                $iX = Abs(($iW - $iW_Stamp) / 2)
                $iY = Abs(($iH - $iH_Stamp) / 2)
                $fX = ($iW_Stamp - $iW_Stamp * $fSize) / 2
                $fY = ($iH_Stamp - $iH_Stamp * $fSize) / 2
            Case 6
                $iX = Abs($iW - $iW_Stamp - Min($iMinW, $iW))
                $iY = Abs(($iH - $iH_Stamp) / 2)
                $fX = ($iW_Stamp - $iW_Stamp * $fSize)
                $fY = ($iH_Stamp - $iH_Stamp * $fSize) / 2
            Case 7
                $iX = Min($iMinW, $iW)
                $iY = Abs($iH - Min($iMinH, $iH) - $iH_Stamp)
                $fY = ($iH_Stamp - $iH_Stamp * $fSize)
            Case 8
                $iX = Abs(($iW - $iW_Stamp) / 2)
                $iY = Abs($iH - Min($iMinH, $iH) - $iH_Stamp)
                $fX = ($iW_Stamp - $iW_Stamp * $fSize) / 2
                $fY = ($iH_Stamp - $iH_Stamp * $fSize)
            Case 9
                $iX = Abs($iW - $iW_Stamp - Min($iMinW, $iW))
                $iY = Abs($iH - Min($iMinH, $iH) - $iH_Stamp)
                $fX = ($iW_Stamp - $iW_Stamp * $fSize)
                $fY = ($iH_Stamp - $iH_Stamp * $fSize)
        EndSwitch
        _GDIPlus_GraphicsDrawImageRectRectIA($hCtxt_Stamp, $hBmp_Stamp, 0, 0, $iW_Stamp, $iH_Stamp, $iX + $fX + $iAdjX, $iY + $fY + $iAdjY, $fW, $fH, $hAttribute_Alpha)
    EndIf
    _GDIPlus_GraphicsDispose($hCtxt_Stamp)
    _GDIPlus_ImageAttributesDispose($hAttribute_Alpha)
EndFunc ;==>_GDIPlus_StampImage

Func Min($a, $b)
    If $a < $b Then Return $a
    Return $b
EndFunc ;==>Min

Func _GDIPlus_ColorMatrixCreateTranslate($nRed, $nGreen, $nBlue, $nAlpha = 0)
    Local $ii, $tCM, $aFactors[4] = [$nRed, $nGreen, $nBlue, $nAlpha]
    $tCM = _GDIPlus_ColorMatrixCreate()
    For $ii = 0 To 3
        DllStructSetData($tCM, "m", $aFactors[$ii], 21 + $ii)
    Next
    Return $tCM
EndFunc ;==>_GDIPlus_ColorMatrixCreateTranslate

Func _GDIPlus_ColorMatrixCreate()
    Return _GDIPlus_ColorMatrixCreateScale(1, 1, 1, 1)
EndFunc ;==>_GDIPlus_ColorMatrixCreate

Func _GDIPlus_ColorMatrixCreateScale($nRed, $nGreen, $nBlue, $nAlpha = 1)
    Local $tCM
    $tCM = DllStructCreate($tagGDIPCOLORMATRIX)
    DllStructSetData($tCM, "m", $nRed, 1)
    DllStructSetData($tCM, "m", $nGreen, 7)
    DllStructSetData($tCM, "m", $nBlue, 13)
    DllStructSetData($tCM, "m", $nAlpha, 19)
    DllStructSetData($tCM, "m", 1, 25)
    Return $tCM
EndFunc ;==>_GDIPlus_ColorMatrixCreateScale

Func _GDIPlus_ImageAttributesSetColorMatrix($hImageAttributes, $iColorAdjustType = 0, $fEnable = False, $pClrMatrix = 0, $pGrayMatrix = 0, $iColorMatrixFlags = 0)
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipSetImageAttributesColorMatrix", "handle", $hImageAttributes, "int", $iColorAdjustType, "int", $fEnable, "ptr", $pClrMatrix, "ptr", $pGrayMatrix, "int", $iColorMatrixFlags)
    If @error Then Return SetError(@error, @extended, False)
    Return $aResult[0] = 0
EndFunc ;==>_GDIPlus_ImageAttributesSetColorMatrix

Func _GDIPlus_ImageAttributesCreate()
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateImageAttributes", "int*", 0)
    If @error Then Return SetError(@error, @extended, 0)
    Return $aResult[1]
EndFunc ;==>_GDIPlus_ImageAttributesCreate

Func _GDIPlus_ImageAttributesDispose($hImageAttributes)
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipDisposeImageAttributes", "handle", $hImageAttributes)
    If @error Then Return SetError(@error, @extended, False)
    Return $aResult[0] = 0
EndFunc ;==>_GDIPlus_ImageAttributesDispose

Func _GDIPlus_GraphicsDrawImageRectRectIA($hGraphics, $hImage, $nSrcX, $nSrcY, $nSrcWidth, $nSrcHeight, $nDstX, $nDstY, $nDstWidth, $nDstHeight, $hImageAttributes = 0, $iUnit = 2)
    Local $aResult = DllCall($ghGDIPDll, "int", "GdipDrawImageRectRect", "handle", $hGraphics, "handle", $hImage, "float", $nDstX, "float", $nDstY, "float", $nDstWidth, "float", $nDstHeight, "float", $nSrcX, "float", $nSrcY, "float", $nSrcWidth, "float", $nSrcHeight, "int", $iUnit, "handle", $hImageAttributes, "int", 0, "int", 0)
    If @error Then Return SetError(@error, @extended, False)
    Return $aResult[0] = 0
EndFunc ;==>_GDIPlus_GraphicsDrawImageRectRectIA

Don't forget to change the path to the stamp image in line 37!!!

Br,

UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...