api_copyimage ( ) keeps returning 0?

Blitz3D Forums/Blitz3D Programming/api_copyimage ( ) keeps returning 0?

Guy Fawkes(Posted 2016) [#1]
Hi guys. Got a little problem here. Why is this returning 0 even though I was successfully able to draw my image on the screen?

link1.bmp:



YES, for the LOVE of god, Link is SICK, do NOT bring this up!

Code.bb:



Thank You for all of the help!

~GF


Dan(Posted 2016) [#2]
the only hint i can give you, after searching blitzbasic forums and the msdn page, is this:

 Global t = api_CopyImage ( valuefirst, IMAGE_BITMAP, ImageWidth ( valuefirst ), ImageHeight ( valuefirst ), LR_COPYFROMRESOURCE )

 DebugLog  api_GetLastError()


CopyImage leads to GetLastError

and the example above returns the number 6, which is, if you look on this page: invalid handle.


col(Posted 2016) [#3]
Assuming that function is a direct call to the Win32 api CopyImage then that function will never work with Blitz related images.
It would be for dealing with images that are loaded via the win32 api function LoadImage as opposed to the Blitz variant.

If that is the case then unfortunately they will return different things and are completely unrelated and not 'transferable' between the 2 function calls.