Sign in to follow this  
Followers 0
jasny

GDIPlus Crashing

3 posts in this topic

Can someone look at the code and check why is that crashing ?

_GDIPlus_Startup()
$fileA = @ScriptDir & "\images\file1.bmp"
$hImageA = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\images\file1.bmp")
$hBitmapA = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImageA)
$pix = _GDIPlus_BitmapGetPixel($hBitmapA,5,5)
consolewrite($pix)
_GDIPlus_ImageDispose($hBitmapA)
_GDIPlus_Shutdown()

thanks

 

Share this post


Link to post
Share on other sites



See my comments:
 

_GDIPlus_Startup()
$fileA = @ScriptDir & "\images\file1.bmp"
$hImageA = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\images\file1.bmp") ;<- this is a GDIPlus bitmap
$hBitmapA = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImageA) ;<- this is a GDI bitmap!
$pix = _GDIPlus_BitmapGetPixel($hBitmapA,5,5) ;<- _GDIPlus_BitmapGetPixel() can handle only GDIPlus bitmaps!
consolewrite($pix)
_GDIPlus_ImageDispose($hBitmapA)
_GDIPlus_Shutdown()

$pix = _GDIPlus_BitmapGetPixel($hImageA,5,5) should work.

 

Br,

UEZ

1 person likes this

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  
Followers 0