Jump to content

GDIPlus Crashing


jasny
 Share

Recommended Posts

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

 

Link to comment
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

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!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...