Jump to content
Sign in to follow this  

@error 10 on _GDIPlus_ImageSaveToFile

Recommended Posts


I load a png image at $hImage32

$sFile = "C:\Form\default.png"
$hImage32 = _GDIPlus_ImageLoadFromFile($sFile)

This $hImage32 is showed in $hBackbuffer

Func _update()
    _GDIPlus_GraphicsClear($hBackbuffer, 0xFFFFFFFF)
    _GDIPlus_GraphicsDrawImageRectRect($hBackbuffer, $hImage32, 0, 0, 32, 32, 0, 0, 32, 32)
    _GDIPlus_GraphicsDrawImageRect($hGraphic, $hBitmap, 0, 0, 32, 32)
EndFunc   ;==>_update

If a error in _update(), ignore... the main question is: I can save the image it is still showed?

Or clear the draw and save?

Whe I call a function to shave $hImage32 the, occur this error:

$TRY = _GDIPlus_ImageSaveToFile($hImage32, $sFile)
_GRID_Save( $hImage32[ 0x02C09480 ] $sFile[ C:\Form\default.png ] $TRY[ False ] @error[ 10 ] @extended[ 7 ] FileExists[ 1 ])

Conform https://msdn.microsoft.com/en-us/library/windows/desktop/ms534175(v=vs.85).aspx

The @error 10 is FileNotFound

The @extended I cant found... (yet)

Someone can help-me to fix this error?

Br, Luigi

Edited by Luigi

Share this post

Link to post
Share on other sites

I'm pretty sure that _GDIPlus_ImageLoadFromFile keeps the file open until the image is released with _GDIPlus_ImageDispose. That's the reason for the error.

Share this post

Link to post
Share on other sites

It's not odd because as long as the image is loaded and not disposed the image is locked by gdiplus!

Theoretically it should work when you load the file as binary string using:


I didn't check it yet...

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Create New...