ahmeddzcom Posted February 16, 2022 Posted February 16, 2022 Hello How i can add image to image ? (Like copy & paste image on paint) Tnx
SOLVE-SMART Posted February 16, 2022 Posted February 16, 2022 Hi @ahmeddzcom, what do you exactly mean? Please describe you requirement a bit more, this would be helpful. Best regards Sven ________________Stay innovative! ahmeddzcom 1 Stay innovative! Spoiler ๐ย Au3Forums ๐ฒ AutoIt (en) Cheat Sheet ๐ AutoIt limits/defaults ๐ Code Katas: [...] (comming soon) ๐ญ Collection of GitHub users with AutoIt projects ๐ย False-Positives ๐ฎย Me on GitHub ๐ฌย Opinion about new forum sub category ๐ย UDF wiki list โย VSCode-AutoItSnippets ๐ย WebDriver FAQs ๐จโ๐ซย WebDriver Tutorial (coming soon)
ad777 Posted February 17, 2022 Posted February 17, 2022 (edited) @ahmeddzcom you can copy image from Paint Window to another Paint Window using Autoit Script: SendKeepActive("1.jpg - Paint") ;Attempts to keep a specified window active during Send(). Send("^a") ;send ctrl + A -> select all Send("^c") ;send ctrl + c -> copy SendKeepActive("2.jpg - Paint") ;Attempts to keep a specified window active during Send(). Send("^v") ;send ctrl + v -> paste ;note title 1: 1.jpg , title 2 2.jpg ย Edited February 17, 2022 by ad777 ahmeddzcom 1 none
ahmeddzcom Posted February 17, 2022 Author Posted February 17, 2022 (edited) Hiย ad777 i need somethig like this codeย this code for text to image , but i need image to image. #include <GDIPlus.au3> _Main() Func _Main() Local $hBitmap, $hImage, $sCLSID, $tData, $tParams, $hWnd, $hGraphic, $hBrush, $hFormat, $hFamily, $hFont, $tLayout, $GUI_EVENT_CLOSE ; Initialize GDI+ library _GDIPlus_Startup () ; Load image $hImage = _GDIPlus_ImageLoadFromFile ("C:\Temp\1.jpg") ; Get JPEG encoder CLSID $sCLSID = _GDIPlus_EncodersGetCLSID ("JPG") ; Draw a string _GDIPlus_Startup () $hBrush = _GDIPlus_BrushCreateSolid (0xFF00007F) $hFormat = _GDIPlus_StringFormatCreate () $hFamily = _GDIPlus_FontFamilyCreate ("Arial") $hFont = _GDIPlus_FontCreate ($hFamily, 12, 2) $tLayout = _GDIPlus_RectFCreate (140, 110, 100, 20) _GDIPlus_GraphicsDrawStringEx ($hImage, "Hello world", $hFont, $hImage, $hFormat, $hBrush) ; Save image _GDIPlus_ImageSaveToFileEx ($hImage, "C:\Temp\desktop.jpg", $sCLSID, DllStructGetPtr($tParams)) ; Shut down GDI+ library _GDIPlus_ShutDown () EndFunc ; Loop until user exits ย Edited February 17, 2022 by ahmeddzcom
ahmeddzcom Posted February 17, 2022 Author Posted February 17, 2022 Python | Copy and Paste Images onto other Image using Pillow - GeeksforGeeks
ahmet Posted February 17, 2022 Posted February 17, 2022 Look for GdiPlusGraphicsDrawImage ahmeddzcom 1
SOLVE-SMART Posted February 17, 2022 Posted February 17, 2022 (edited) Hi @ahmeddzcom, I did a similar thing in the past, but the script just appends several images to a long single image. Maybe I find that code and can adjust this or you will do it on your own. Depends on finding the script ๐ . I'll get back soon. Best regards Sven ________________Stay innovative! Edited February 17, 2022 by SOLVE-SMART ahmeddzcom 1 Stay innovative! Spoiler ๐ย Au3Forums ๐ฒ AutoIt (en) Cheat Sheet ๐ AutoIt limits/defaults ๐ Code Katas: [...] (comming soon) ๐ญ Collection of GitHub users with AutoIt projects ๐ย False-Positives ๐ฎย Me on GitHub ๐ฌย Opinion about new forum sub category ๐ย UDF wiki list โย VSCode-AutoItSnippets ๐ย WebDriver FAQs ๐จโ๐ซย WebDriver Tutorial (coming soon)
smbape Posted February 17, 2022 Posted February 17, 2022 Hi @ahmeddzcom Using OpenCV v4 UDF #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseX64=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include "autoit-opencv-com\udf\opencv_udf_utils.au3" _OpenCV_Open_And_Register("opencv-4.5.5-vc14_vc15\opencv\build\x64\vc15\bin\opencv_world455.dll", "autoit-opencv-com\autoit_opencv_com455.dll") Global $cv = _OpenCV_get() Global $big = $cv.imread("cat.jpg") Global $small = $cv.imread("core.jpg") ; Rect is [x, y, width, height] Global $roi[4] = [($big.width - $small.width) / 2, ($big.height - $small.height) / 2, $small.width, $small.height ] $small.copyTo(ObjCreate("OpenCV.cv.Mat").create($big, $roi)) $cv.imwrite(@ScriptDir & "\pasted2.png", $big) $cv.imshow("copy", $big) $cv.waitKey() $cv.destroyAllWindows() _OpenCV_Unregister_And_Close() ย ahmeddzcom 1
SOLVE-SMART Posted February 17, 2022 Posted February 17, 2022 Hi again, damn, right now I saw the post of @ahmet who directed already to the solution ๐ . The first example in the help reference to _GDIPlus_GraphicsDrawImage should be exactly what you're looking for. Best regards Sven ________________Stay innovative! ahmeddzcom 1 Stay innovative! Spoiler ๐ย Au3Forums ๐ฒ AutoIt (en) Cheat Sheet ๐ AutoIt limits/defaults ๐ Code Katas: [...] (comming soon) ๐ญ Collection of GitHub users with AutoIt projects ๐ย False-Positives ๐ฎย Me on GitHub ๐ฌย Opinion about new forum sub category ๐ย UDF wiki list โย VSCode-AutoItSnippets ๐ย WebDriver FAQs ๐จโ๐ซย WebDriver Tutorial (coming soon)
ahmeddzcom Posted February 17, 2022 Author Posted February 17, 2022 thanks to all #include <GDIPlus.au3> #include <ScreenCapture.au3> #include <WinAPI.au3> Local $hBitmap1, $hBitmap2, $hImage1, $hImage2, $hGraphic ; Initialize GDI+ library _GDIPlus_Startup() $hImage1 = _GDIPlus_ImageLoadFromFile("C:\Users\AhmedDzCom\Desktop\1.jpg") ;size is 68x71 $hImage2 = _GDIPlus_ImageLoadFromFile("C:\Users\AhmedDzCom\Desktop\2.jpg") ;size is 193x184 ; Draw one image in another $hGraphic = _GDIPlus_ImageGetGraphicsContext($hImage1) _GDIPlus_GraphicsDrawImage($hGraphic, $hImage2, 100, 100) ; Save resultant image _GDIPlus_ImageSaveToFile($hImage1, @MyDocumentsDir & "\GDIPlus_Image.jpg") ; Clean up resources _GDIPlus_ImageDispose($hImage1) _GDIPlus_ImageDispose($hImage2) _WinAPI_DeleteObject($hBitmap1) _WinAPI_DeleteObject($hBitmap2) ; Shut down GDI+ library _GDIPlus_Shutdown() ShellExecute(@MyDocumentsDir & "\GDIPlus_Image.jpg") ย
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