nend 36 Posted November 29, 2012 (edited) Hoi, I've got one logo ( jpg 150x150 pixels) and a shade (png 110X110 pixels) How can I resize the logo to 110x110 and lay over (inserted) the shade jpg so that the picture is 110x110 Everytime I'd tryd to do that the logo gets smaller but also the shade gets smaller in ratio. How can I make this right? #include "GDIPlus.au3" #include "GuiConstantsEx.au3" Local $hGUI, $hImagelogo, $hImageshade, $hGraphicpop $hGUI = GUICreate("", 400, 400) GUISetState() _GDIPlus_StartUp() $hGraphicpop = _GDIPlus_GraphicsCreateFromHWND($hGUI) $hImagelogo = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\test.jpg") $hImageshade = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\shade.png") $hGraphic = _GDIPlus_ImageGetGraphicsContext($hImagelogo) _GDIPlus_GraphicsDrawImage ($hGraphic, $hImageshade, 0, 0) _GDIPLus_GraphicsDrawImageRect($hGraphicpop, $hImagelogo, 20, 20, 110, 110) Do Sleep(20) until GUIGetMsg() = $GUI_EVENT_CLOSE _GDIPlus_GraphicsDispose($hGraphicpop) _GDIPlus_ImageDispose($hImagelogo) _GDIPlus_ImageDispose($hImageshade) _GDIPlus_ShutDown() Edited November 29, 2012 by nend Share this post Link to post Share on other sites
UEZ 1,118 Posted November 29, 2012 (edited) Please provide the images. Btw, it is not GDI but GDI+. Br, UEZ Edited November 29, 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!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Share this post Link to post Share on other sites
nend 36 Posted November 29, 2012 (edited) Please provide the images.Btw, it is not GDI but GDI+. Br,UEZHoi UEZ,Thanks for looking at it.I've inserted the image in the first post.I can place the shade image on the logo image on a gui but I want to saves it as 1 image finally. Edited November 29, 2012 by nend Share this post Link to post Share on other sites
UEZ 1,118 Posted November 29, 2012 Try this: #include <GUIConstantsEx.au3> #include <GDIPlus.au3> Local $hGUI, $hImagelogo, $hImageshade, $hGraphicpop $hGUI = GUICreate("", 400, 400) GUISetState() _GDIPlus_StartUp() $hGraphicpop = _GDIPlus_GraphicsCreateFromHWND($hGUI) $hImagelogo = _GDIPlus_ImageLoadFromFile(@ScriptDir & "test.jpg") $hImageshade = _GDIPlus_ImageLoadFromFile(@ScriptDir & "shade.png") $iW_bg = _GDIPlus_ImageGetWidth($hImagelogo) $iH_bg = _GDIPlus_ImageGetHeight($hImagelogo) $hBitmap = _GDIPlus_BitmapCreateFromGraphics($iW_bg, $iH_bg, $hGraphicpop) $hGraphic = _GDIPlus_ImageGetGraphicsContext($hBitmap) $iW_fg = _GDIPlus_ImageGetWidth($hImageshade) $iH_fg = _GDIPlus_ImageGetHeight($hImageshade) _GDIPLus_GraphicsDrawImageRect($hGraphic, $hImagelogo, 0, 0, $iW_bg, $iH_bg) _GDIPLus_GraphicsDrawImageRect($hGraphic, $hImageshade, $iW_bg - $iW_fg, 0, $iW_fg, $iH_bg) _GDIPlus_GraphicsDrawImageRect($hGraphicpop, $hBitmap, 0, 0, $iW_bg, $iH_bg) _GDIPlus_ImageSaveToFile($hBitmap, @ScriptDir & "Result.jpg") Do Sleep(20) until GUIGetMsg() = $GUI_EVENT_CLOSE _GDIPlus_ImageDispose($hImagelogo) _GDIPlus_ImageDispose($hImageshade) _GDIPlus_BitmapDispose($hBitmap) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_GraphicsDispose($hGraphicpop) _GDIPlus_ShutDown() 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!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Share this post Link to post Share on other sites
nend 36 Posted November 29, 2012 Try this: #include <GUIConstantsEx.au3> #include <GDIPlus.au3> Local $hGUI, $hImagelogo, $hImageshade, $hGraphicpop $hGUI = GUICreate("", 400, 400) GUISetState() _GDIPlus_StartUp() $hGraphicpop = _GDIPlus_GraphicsCreateFromHWND($hGUI) $hImagelogo = _GDIPlus_ImageLoadFromFile(@ScriptDir & "test.jpg") $hImageshade = _GDIPlus_ImageLoadFromFile(@ScriptDir & "shade.png") $iW_bg = _GDIPlus_ImageGetWidth($hImagelogo) $iH_bg = _GDIPlus_ImageGetHeight($hImagelogo) $hBitmap = _GDIPlus_BitmapCreateFromGraphics($iW_bg, $iH_bg, $hGraphicpop) $hGraphic = _GDIPlus_ImageGetGraphicsContext($hBitmap) $iW_fg = _GDIPlus_ImageGetWidth($hImageshade) $iH_fg = _GDIPlus_ImageGetHeight($hImageshade) _GDIPLus_GraphicsDrawImageRect($hGraphic, $hImagelogo, 0, 0, $iW_bg, $iH_bg) _GDIPLus_GraphicsDrawImageRect($hGraphic, $hImageshade, $iW_bg - $iW_fg, 0, $iW_fg, $iH_bg) _GDIPlus_GraphicsDrawImageRect($hGraphicpop, $hBitmap, 0, 0, $iW_bg, $iH_bg) _GDIPlus_ImageSaveToFile($hBitmap, @ScriptDir & "Result.jpg") Do Sleep(20) until GUIGetMsg() = $GUI_EVENT_CLOSE _GDIPlus_ImageDispose($hImagelogo) _GDIPlus_ImageDispose($hImageshade) _GDIPlus_BitmapDispose($hBitmap) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_GraphicsDispose($hGraphicpop) _GDIPlus_ShutDown() Br, UEZ Thanks UEZ, I't works great, I'm gonna studdy that script so the next time I can do it my self. Regards, Nend Share this post Link to post Share on other sites