telmob Posted March 3, 2012 Share Posted March 3, 2012 Hello again guys. Hope you're all having a nice weekend. Ok, so... i have a question i hope you can help me with. I have a program (almost finished) to make reports for my company, and at the end of the report, the program places an image of a digitalized signature of the guy that makes the report, but.... i'm trying to add some security to it, so our clients, don't just steal that digital signature and place it in another report. So, i thought about adding the date to that picture (signature), and save the picture after so the picture and the date in it are all the same and not distinct objects. Is there a way to do that? Ofcourse this is just my idea in how to add extra security to the signatures, but i'm open to suggestions Link to comment Share on other sites More sharing options...
wakillon Posted March 3, 2012 Share Posted March 3, 2012 May be something like this expandcollapse popup#include <GDIPlus.au3> _AddTextToPic ( @DesktopDir & 'Image.jpg', @MyDocumentsDir & 'Image2.jpg', "Signature", 20, 450 ) _DisplayPic ( @MyDocumentsDir & 'Image2.jpg' ) Exit Func _AddTextToPic ( $_ImagePath, $_Outputpath, $sString, $_X=0, $_Y=0 ) Local $hBitmap, $hImage, $hGraphic, $hFamily, $hFont, $tLayout, $hFormat, $aInfo, $hBrush1, $hBrush2, $iWidth, $iHeight, $hPen ; Initialize GDI+ library _GDIPlus_StartUp ( ) ; Load image and emboss text $hImage = _GDIPlus_ImageLoadFromFile ( $_ImagePath ) $hGraphic = _GDIPlus_ImageGetGraphicsContext ( $hImage ) $hFamily = _GDIPlus_FontFamilyCreate ( "Arial" ) $hFont = _GDIPlus_FontCreate ( $hFamily, 38, 1 ) $hFormat = _GDIPlus_StringFormatCreate ( 0x4000 ) $hBrush2 = _GDIPlus_BrushCreateSolid ( 0xff000000 ) $hPen = _GDIPlus_PenCreate ( 0xC4000000, 1 ) ; Set Text Pos $tLayout = _GDIPlus_RectFCreate ( $_X, $_Y ) $aInfo = _GDIPlus_GraphicsMeasureString ( $hGraphic, $sString, $hFont, $tLayout, $hFormat ) _GDIPlus_GraphicsDrawStringEx ( $hGraphic, $sString, $hFont, $aInfo[0], $hFormat, $hBrush2 ) ; Save image _GDIPlus_ImageSaveToFile ( $hImage, $_Outputpath ) ; 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 ( ) EndFunc ;==> _AddTextToPic ( ) Func _DisplayPic ( $_ImagePath ) Run ( 'rundll32 shimgvw.dll,ImageView_Fullscreen ' & $_ImagePath ) EndFunc ;==> _DisplayPic ( ) AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
UEZ Posted March 3, 2012 Share Posted March 3, 2012 (edited) I wrote some time ago a function to write a text to an image: Write Text on Bitmap()Maybe it is useful for you.Link points to the German Autoit site.Br,UEZ Edited March 3, 2012 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 More sharing options...
telmob Posted March 3, 2012 Author Share Posted March 3, 2012 Thanks guys. I'm trying wakillon code first but... i'm getting this error: _DisplayPic - Undefined function Link to comment Share on other sites More sharing options...
guinness Posted March 3, 2012 Share Posted March 3, 2012 The error is telling you that you didn't copy _DisplayPic from wakillon's example. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
wakillon Posted March 3, 2012 Share Posted March 3, 2012 Thanks guys.I'm trying wakillon code first but... i'm getting this error:_DisplayPic - Undefined functionIt's just for display directly the result in Microsoft viewer.Remove the line in cause. AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
telmob Posted March 3, 2012 Author Share Posted March 3, 2012 Geezzzz... I forgot to copy the whole thing... how very lame of me Thanks again guys. My problem is solved Link to comment Share on other sites More sharing options...
wakillon Posted March 3, 2012 Share Posted March 3, 2012 Geezzzz... I forgot to copy the whole thing... how very lame of me Thanks again guys. My problem is solved If you have some time take a look at UEZ advanced scripts in post#3 AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
telmob Posted March 3, 2012 Author Share Posted March 3, 2012 Will do it now! Thank you so much! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now