Jump to content

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


UEZ
 Share

Recommended Posts

UEZ, I was put down all week by an infection, so no oppotunity to do anything at all.

I will have a go at your tool asap and let you know about messed up screen result.

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

Link to comment
Share on other sites

Thank's UEZ

your code editing..to

;Add Var

Global$xMoveSlider_WM,$yMoveSlider_WM

Global$hxMoveSlider_WM,$hyMoveSlider_WM

Global$xGap=0,$yGap=0

;Add Var

68~73 Line

Disable Code is

;$iPos_WM = 9 <=== Stop Radio

Add Code is..

;Add Controll <=============================================

$xMoveSlider_WM=GUICtrlCreateSlider(16,645,$iW_Grp_WM,20,BitOR($GUI_SS_DEFAULT_SLIDER,$TBS_BOTH,$TBS_ENABLESELRANGE))

GUICtrlSetBkColor(-1,0xF0F0F0)

GUICtrlSetLimit(-1,$iW_Grp_WM)

$hxMoveSlider_WM=GUICtrlGetHandle($xMoveSlider_WM)

$yMoveSlider_WM=GUICtrlCreateSlider($iW_Grp_WM+20,176,20,$iH_Grp_WM,BitOR($GUI_SS_DEFAULT_SLIDER,$TBS_VERT,$TBS_ENABLESELRANGE))

GUICtrlSetLimit(-1,$iH_Grp_WM)

GUICtrlSetBkColor(-1,0xF0F0F0)

$hyMoveSlider_WM=GUICtrlGetHandle($yMoveSlider_WM)

;Add Controll <=============================================

Add Code is..

Case$idButtonloadImage_WM

...

;// select pic Width/Height size to Slider Limit ...

GUICtrlSetLimit($xMoveSlider_WM,$bW)

GUICtrlSetLimit($yMoveSlider_WM,$bH)

;// select pic Width/Height size to Slider Limit ...

....

Change Code is..

Case$hPicStampPreview_WM

;Stop Code

#cs

$hBitmap_Stamp_w = Int($hBitmap_Stamp_w / $f / 2)

$hBitmap_Stamp_h = Int($hBitmap_Stamp_h / $f / 2)

#ce

;Stop Code

;Change Code overlap png is 100%

$hBitmap_Stamp_w=$hBitmap_Stamp_w;Int($hBitmap_Stamp_w / $f / 2)

$hBitmap_Stamp_h=$hBitmap_Stamp_h;Int($hBitmap_Stamp_h / $f / 2)

;Change Code overlap png is 100%

Edit Code is..

Case$idCheckboxCircular_WM

....

;Stop Scan Radio

#cs

Case $idRadioUpperLeft_WM

$iPos_WM = 1

UpdatePreview_WM()

Case $idRadioUpperMid_WM

$iPos_WM = 2

UpdatePreview_WM()

Case $idRadioUpperRight_WM

$iPos_WM = 3

UpdatePreview_WM()

Case $idRadioMidLeft_WM

$iPos_WM = 4

UpdatePreview_WM()

Case $idRadioCenter_WM

$iPos_WM = 5

UpdatePreview_WM()

Case $idRadioMidRight_WM

$iPos_WM = 6

UpdatePreview_WM()

Case $idRadioButtomLeft_WM

$iPos_WM = 7

UpdatePreview_WM()

Case $idRadioButtomMid_WM

$iPos_WM = 8

UpdatePreview_WM()

Case $idRadioButtomRight_WM

$iPos_WM = 9

UpdatePreview_WM()

#ce

;Stop Scan Radio

.....

Func _GDIPlus_StampImage($hBmp,$hBmp_Stamp,$fAlpha=0.25,$iMinW=8,$iMinH=8)

....

;Stop Code

#cs

If $iPos_WM Then

Switch $iPos_WM

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

EndIf

#ce

;Stop Code

;Change Code <===========================

$iX=$xGap

$iY=$yGap

ConsoleWrite('iX:'&$ix&" iY:"&$iY&@CRLF)

;Change Code <===========================

.....

Func _GDIPlus_WatermarkImage($hBitmap,$sText,$iX,$iY,$iPos=0,$sFontName="Arial",$iFontSize=16,$fAngle=0,$iAdjY=0,$iAdjX=0,$iFontColor=0xFFFFFF,$fAlpha=0.25,$bLineBreak=True)

....

;Stop Code

#cs

If Not Int($iPos) Or Int($iPos) > 9 Then

DllStructSetData($tLayout, "x", $iX)

DllStructSetData($tLayout, "y", $iY)

Else

DllStructSetData($tLayout, "x", $iAdjX)

DllStructSetData($tLayout, "width", $iW)

Switch $iPos

Case 1 To 3

DllStructSetData($tLayout, "y", $iAdjY)

_GDIPlus_StringFormatSetAlign($hFormat, $iPos - 1)

Case 4 To 6

DllStructSetData($tLayout, "y", ($iH - $iHTxt) / 2 + $iAdjY)

_GDIPlus_StringFormatSetAlign($hFormat, $iPos - 4)

Case 7 To 9

DllStructSetData($tLayout, "y", $iH - $iHTxt + $iAdjY)

_GDIPlus_StringFormatSetAlign($hFormat, $iPos - 7)

EndSwitch

EndIf

#ce

;Stop Code

;Change Code

;// Scan Slider Value to Text Area

$iX=$xGap

$iY=$yGap

ConsoleWrite('nofAngle iX:'&$iX&" iY:"&$iY&@CRLF)

DllStructSetData($tLayout,"x",$xGap)

DllStructSetData($tLayout,"y",$yGap)

;Change Code

.....

Func _GDIPlus_WatermarkImage($hBitmap,$sText,$iX,$iY,$iPos=0,$sFontName="Arial",$iFontSize=16,$fAngle=0,$iAdjY=0,$iAdjX=0,$iFontColor=0xFFFFFF,$fAlpha=0.25,$bLineBreak=True)

....

;Stop Code

#cs

If $iPos Then

Switch $iPos

Case 1

$iX = $iAdjX + $iFontSize

$iY = $iAdjY

Case 2

$iX = $iAdjX + ($iW + $iFontSize) / 2

$iY = $iAdjY

Case 3

$iX = $iAdjX + $iW - $iFontSize / 2

$iY = $iAdjY

Case 4

$iX = $iAdjX + $iFontSize * 1.25

$iY = $iAdjY + $iH / 2 - $iFontSize

Case 5

$iX = $iAdjX + ($iW + $iFontSize) / 2

$iY = $iAdjY + $iH / 2 - $iFontSize

Case 6

$iX = $iAdjX + $iW - $iFontSize / 2

$iY = $iAdjY + $iH / 2 - $iFontSize

Case 7

$iX = $iAdjX + $iFontSize * 1.25

$iY = $iAdjY + $iH - $iFontSize * 1.25

Case 8

$iX = $iAdjX + ($iW + $iFontSize) / 2

$iY = $iAdjY + $iH - $iFontSize * 1.25

Case 9

$iX = $iAdjX + $iW - $iFontSize / 2

$iY = $iAdjY + $iH - $iFontSize * 1.25

EndSwitch

EndIf

#ce

;Stop Code

;Change Code

DllStructSetData($tLayout,"x",$xGap)

DllStructSetData($tLayout,"y",$yGap)

ConsoleWrite('YesfAngle iX:'&$iX&" iY:"&$iY&@CRLF)

;Change Code

.....

Func _GDIPlus_CreateRotatedLetters($hBitmap,$sText,$iPos=9,$iFontSize=16,$iRadius=100,$sFont="Impact",$iFontColor=0xFFFFFF,$fAlpha=0.04,$fStart_angle=0)

....

#cs

Switch $iPos

Case 1

$iPosX = $iRadius + $iFontSize

$iPosY = $iRadius + $iFontSize

Case 2

$iPosX = $iW / 2

$iPosY = $iRadius + $iFontSize

Case 3

$iPosX = $iW - ($iRadius + $iFontSize)

$iPosY = $iRadius + $iFontSize

Case 4

$iPosX = $iRadius + $iFontSize

$iPosY = $iH / 2

Case 5

#ce

$iPosX=$iW/2

$iPosY=$iH/2

#cs

Case 6

$iPosX = $iW - ($iRadius + $iFontSize)

$iPosY = $iH / 2

Case 7

$iPosX = $iRadius + $iFontSize

$iPosY = $iH - ($iRadius + $iFontSize)

Case 8

$iPosX = $iW / 2

$iPosY = $iH - ($iRadius + $iFontSize)

Case 9

$iPosX = $iW - ($iRadius + $iFontSize)

$iPosY = $iH - ($iRadius + $iFontSize)

EndSwitch

#ce

;Add Code

ConsoleWrite('iPosX:'&$iPosX&' iPosY:'&$iPosY&@CRLF)

.....

Func WM_VSCROLL_WM($hWnd,$Msg,$wParam,$lParam)

#forceref $hWnd, $Msg, $wParam

Switch$lParam

;Add Slider

Case$hyMoveSlider_WM; Up Down..

Local$yPos=GUICtrlRead($yMoveSlider_WM)

$yGap=$yPos

UpdatePreview_WM()

;Add Slider

Func WM_HSCROLL_WM($hWnd,$Msg,$wParam,$lParam)

#forceref $hWnd, $Msg

Switch$lParam

;Add Slider

Case$hxMoveSlider_WM;Left Right..

Local$xPos=GUICtrlRead($xMoveSlider_WM)

$xGap=$xPos

UpdatePreview_WM()

;Add Slider

edit code download

Posted Image

Posted Image

Posted Image

<a name="cke_range_marker">

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

original pic with overlap png match is 100% editing...

bottom slider bar / right slider bar moving Text and overlap png can.....editing...

but round text not moving.......

Edited by davidkim

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 like the idea with the sliders right / buttom to the preview pic to position the text manually! I will implement it in one of the next releases!

But first I will implement the command line parameters...

Thanks.

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

Posted Image

overlap pattern png is can?

1. image

Posted Image

2. overlay pattern image (png)

Posted Image ----> png to Posted Image

1 image + png

Posted Image

input png overlay patten auto adding..to

Posted Image

png is

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

You mean to fill pattern onto the picture?

Currently you can load an image, position it to left upper corner and scale it using the vertical slider.

Posted Image

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

@davidkim

Excellent ideas, but how about using the tag [AutoIt ] and even tag [spoiler ] to make the topic more organized and easy to read?

JS

http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!)

Somewhere Out ThereJames Ingram

somewh10.png

dropbo10.pngDownload Dropbox - Simplify your life!
Your virtual HD wherever you go, anywhere!

Link to comment
Share on other sites

@davidkim

Excellent ideas, but how about using the tag [AutoIt ] and even tag [spoiler ] to make the topic more organized and easy to read?

JS

the code is http://cafe.naver.com/autoitscript/4753

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

You mean to fill pattern onto the picture?

Currently you can load an image, position it to left upper corner and scale it using the vertical slider.

Posted Image

Br,

UEZ

i am using jpg+png

1.

Posted Image

2.

Posted Image

3. convert

Posted Image

i want conver jpg is

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

Updated to AutoIt Watermark Image v0.75 beta build 2012-11-23.

CMD functionality is not fully tested! Any feedback would be nice!

Thanks to davidkim for the suggestion with the slider to move text / image manually.

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

UEZ: still waiting to test on my work PC with XP. Assume OK though.

I did test on my Win7 machine. One feedback I have is perhaps more a personal way of seeing things than anything else. You may of course think differently. But, here goes:

When I click on the 9 different positions for the text, U/L, U/C U/R etc you correctly position the text there. What I would like is to have the text extend FROM that point. Example: in U/L corner, have the text adjusted by top position, left-aligned.

And in reverse, have B/R align the text right and bottom.

Right now it's a little hard to position a text flush with margin left/right.

I have a buch of other wished, but will spare them for now.

Good to see you keep updating it.

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

Link to comment
Share on other sites

Just keeps getting better.

I notice this morning that when I click certain buttons they want to stay focused no matter what. Example: click "Apply" and if I then want to add more, different text, I change the text box/font/whatever.

Now, what is the intuitive way to input text in an input field ? Yep, type + ENTER.

Unfortunately the APPLY button has focus. So new text is applied directly on top of other.

Would it be possible to remove focus from these buttons again ? Same with color chooser + more button etc etc.

Maybe default focus on text entry after buttonpress ?

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

Link to comment
Share on other sites

One hint:

It would be nice if the main window could be maximized / resizable!

"I love graphics programs, this deserves Rating 10"

JS

That's not so easy to implement because of the graphic handle within the GUI but I will see how complex it will be to implement this afterwards without redesigning the complete code.

UEZ: still waiting to test on my work PC with XP. Assume OK though.

I did test on my Win7 machine. One feedback I have is perhaps more a personal way of seeing things than anything else. You may of course think differently. But, here goes:

When I click on the 9 different positions for the text, U/L, U/C U/R etc you correctly position the text there. What I would like is to have the text extend FROM that point. Example: in U/L corner, have the text adjusted by top position, left-aligned.

And in reverse, have B/R align the text right and bottom.

Right now it's a little hard to position a text flush with margin left/right.

I have a buch of other wished, but will spare them for now.

Good to see you keep updating it.

Are the sliders not working properly to adjust the text or too inaccurate?

In the next update program

Made us able to choose a font

i want......choose order fonts.....

The problem is that not each font is GDI+ compatible. Anyway, it is a good idea to load and use a non installed font.

If I find a way I will add all GDI+ compatible fonts installed on the system.

Just keeps getting better.

I notice this morning that when I click certain buttons they want to stay focused no matter what. Example: click "Apply" and if I then want to add more, different text, I change the text box/font/whatever.

Now, what is the intuitive way to input text in an input field ? Yep, type + ENTER.

Unfortunately the APPLY button has focus. So new text is applied directly on top of other.

Would it be possible to remove focus from these buttons again ? Same with color chooser + more button etc etc.

Maybe default focus on text entry after buttonpress ?

Yes, indeed this is annoying. I will fix it.

Thank you all for your feedback! :thumbsup:

Somebody tested the cmd functionality? I know it is not well documented...

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

UEZ,

Have to admit that I did not SEE the sliders so this part is fine. Sorry

Could you please check angled text and different placements ? I think it seems to work opposite of logic, example: text 45 degree up, placed bottom left. It will be placed 45 degrees DOWN, away from center. Surely, this can be adjusted again, but not logic to me.

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.

I will try to test cmd.line. One important aspect about that one: did you make an escape-string function ? So that I can overlay images with My Text -f has -z this " -m specials as an example.Yes, perhaps thought example, but some day someone will need this. I know from experience :)

Did you test unicode and RTL ? Did that myself, works perfectly.

Edited by Myicq

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

Link to comment
Share on other sites

UEZ,

Have to admit that I did not SEE the sliders so this part is fine. Sorry

No problem! ;)

Could you please check angled text and different placements ? I think it seems to work opposite of logic, example: text 45 degree up, placed bottom left. It will be placed 45 degrees DOWN, away from center. Surely, this can be adjusted again, but not logic to me.

Well, the logic behind this is e.g. if you rotate the text in the lower left corner for 40° and click the right upper corner then the text is normally outside the visible area. To avoid this I tried to change the rotation appropiately that the text has the same degree but is in the visible area.

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?

I will try to test cmd.line. One important aspect about that one: did you make an escape-string function ? So that I can overlay images with My Text -f has -z this " -m specials as an example.Yes, perhaps thought example, but some day someone will need this. I know from experience :)

Did you test unicode and RTL ? Did that myself, works perfectly.

Hmm, parsing command line parameters is not easy especially when you want to catch all possible variations e.g. with " ' - when you use this characters to specify parameter options. Let me think about it and maybe I will find a way to check also paramters settings with one of those characters.

Btw, I implemented the option to read all installed fonts and put them into the combobox and further to load and use a non installed font.

Thanks for your feedback! Without your feedbacks this little tool would not be where it is currently. :thumbsup:

Br,

UEZ :rolleyes:

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...