rapot 1 Posted January 17, 2012 I want to load an image file, edit..., then... save it. Load image : #include <gdip.au3> #include <GDIPlus.au3> $image = _GDIPlus_ImageLoadFromFile(@MyDocumentsDir & "\GDIPlus_Image.jpg") Edit : put pixel _GDIPlus_BitmapSetPixel($image, 15, 10, 0xffff00ff) Save : _GDIPlus_ImageSaveToFile($image, @MyDocumentsDir & "\GDIPlus_Image.jpg") so it don't work. Please help me. Share this post Link to post Share on other sites
UEZ 1,278 Posted January 17, 2012 Try this here: #include <GDIPlus.au3> _GDIPlus_Startup() Global Const $sFile = StringReplace(@AutoItExe, "autoit3.exe", "ExamplesGUITorus.png") Global Const $hBrush = _GDIPlus_BrushCreateSolid(0x80FFFF00) Global Const $hBitmap = _GDIPlus_BitmapCreateFromFile($sFile) Global Const $iW = _GDIPlus_ImageGetWidth($hBitmap ) Global Const $iH = _GDIPlus_ImageGetHeight($hBitmap ) Global Const $hContext = _GDIPlus_ImageGetGraphicsContext($hBitmap) _GDIPlus_GraphicsFillRect($hContext, $iW / 3, $iH / 3, $iW / 3, $iH / 3, $hBrush) _GDIPlus_ImageSaveToFile($hBitmap, @ScriptDir & "Test.jpg") _GDIPlus_BitmapDispose($hBitmap) _GDIPlus_GraphicsDispose($hContext) _GDIPlus_BrushDispose($hBrush) _GDIPlus_Shutdown() ShellExecute(@ScriptDir & "Test.jpg") 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
rapot 1 Posted January 18, 2012 still save as different file. I want save : _GDIPlus_ImageSaveToFile($hBitmap, $sFile) overwrite not work? Share this post Link to post Share on other sites
UEZ 1,278 Posted January 18, 2012 (edited) The file is locked by GDI+. Just save it with a different name and when file has been unlocked delete original file and rename new file back to original filename. Br, UEZ Edited January 18, 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