Code: Select all
If DatabaseQuery(DatabaseHandle, SQLExpr)
If NextDatabaseRow(DatabaseHandle)
bytecount = DatabaseColumnSize(DatabaseHandle, ColIndex)
If bytecount > 0
*membuffer = AllocateMemory(bytecount)
If *membuffer
tmpimage = CreateImage(#PB_Any, 10, 10)
Debug tmpimage ; = 36950176
GetDatabaseBlob(DatabaseHandle, ColIndex, *membuffer, bytecount)
CatchImage(tmpimage, *membuffer, bytecount)
SetGadgetState(ImageGadget, ImageID(tmpimage))
FreeMemory(*membuffer)
Else ; allocation error
FinishDatabaseQuery(DatabaseHandle)
ProcedureReturn #False
EndIf
Else ; no data in column
FinishDatabaseQuery(DatabaseHandle)
ProcedureReturn #False
EndIf
Else ; no record found
FinishDatabaseQuery(DatabaseHandle)
ProcedureReturn #False
EndIf
FinishDatabaseQuery(DatabaseHandle)
ProcedureReturn #True
Else ; query failed
ProcedureReturn #False
EndIf
CatchImage() fails with '[ERROR] #Image object number is very high (over 100000), are You sure of that ?'
If I hard-code tmpImage to a value < 100,000, everything works just fine.
Looks like an error trap that should be no longer active? Did Fred bump up the number range for gadgets? Or am i missing something?