nhockm4v Posted May 15, 2018 Posted May 15, 2018 (edited) hello all, this is my code: #include <GDIPlus.au3> $image_bg = "bg.png" $image_logo = "logo.png" $image_out = "result.png" InmageInImage ($image_out, $image_bg, $image_logo, 20) Func InmageInImage ($image_out, $image_bg, $image_logo, $Rotate = 0) _GDIPlus_Startup () $hBitmap = _GDIPlus_BitmapCreateFromFile ($image_bg) $hBitmap1 = _GDIPlus_BitmapCreateFromFile ($image_logo) $iW = _GDIPlus_ImageGetWidth ($hBitmap1) $iH = _GDIPlus_ImageGetHeight ($hBitmap1) $iW2 = $iW / 2 $iH2 = $iH / 2 ; rotate $hGraphic = _GDIPlus_ImageGetGraphicsContext ($hBitmap) $hMatrix = _GDIPlus_Matrixcreate () _GDIPlus_MatrixTranslate ($hMatrix, $iW2, $iW2) _GDIPlus_MatrixRotate ($hMatrix, $Rotate) _GDIPlus_GraphicsSetTransform ($hGraphic, $hMatrix) _GDIPlus_MatrixTranslate ($hMatrix, -$iW2, -$iW2) _GDIPlus_GraphicsDrawImage ($hGraphic, $hBitmap1, -$iW2, -$iH2) _GDIPlus_ImageSaveToFile ($hBitmap, @ScriptDir & "\" & $image_out) ShellExecute (@ScriptDir & "\" & $image_out) ; dispose _GDIPlus_MatrixDispose ($hMatrix) _GDIPlus_GraphicsDispose ($hGraphic) _GDIPlus_BitmapDispose ($hBitmap) _GDIPlus_BitmapDispose ($hBitmap) _GDIPlus_Shutdown () EndFunc This code can rotate Add image to image but can not customize image location logo.png in bg.png image, i've tried changing _GDIPlus_GraphicsDrawImage ($hGraphic, $hBitmap1, - $iW2, -$iH2 ) to _GDIPlus_GraphicsDrawImage ( $hGraphic, $hBitmap1, -$iW2 + 20, -$iH2 + 30), but the coordinates are wrong (but if set $ Rotate = 0, it works), any help? Thank you code.zip Edited May 16, 2018 by nhockm4v
Andreik Posted May 16, 2018 Posted May 16, 2018 (edited) Maybe if you upload the images we can help you. And what is _GDIPlus_MatrixTao? Edited May 16, 2018 by Andreik nhockm4v 1
nhockm4v Posted May 16, 2018 Author Posted May 16, 2018 27 minutes ago, Andreik said: Maybe if you upload the images we can help you. And what is _GDIPlus_MatrixTao? this is my code and image code.zip
Andreik Posted May 16, 2018 Posted May 16, 2018 Can you edit a photo to see what result do you expect?
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