However, I can't for the love of me display that image on the screen.
I first tried to work with the examples given in the latest documentation for the library, and that only produced a few dozen random pixels (using direct memory access using FI's methods). Then I tried the pixel colour retrieval method, and that isn't displaying ANYTHING.
Here is my code (for my second method):
Code: Select all
#include "freeimage.bi"
screen 20
dim as FIBITMAP ptr imgtest = _FreeImage_Load(_FreeImage_GetFileType("assets\img\1.png"), "assets\img\1.png")
for y as uinteger = 0 to _FreeImage_GetHeight(imgtest)-1
for x as uinteger = 0 to _FreeImage_GetWidth(imgtest)-1
dim as RGBQUAD col
_FreeImage_GetPixelColor(imgtest, x, y, @col)
pset (x, y), rgba(col.rgbRed, col.rgbGreen, col.rgbBlue, col.rgbReserved)
next
next
sleep
_FreeImage_Unload(imgtest)
I have debugged the values of GetPixelColor, the col. members, and rgba(), they all produce valid values. But when put together, it doesn't work at all!
A note: I have had to prepend underscores to all the symbols because when I constructed the input library for the DLL, pexport and dlltool seemed to do this. BTW, do any end-users of apps using FreeImage (as an example) require the input library to run the software or is it only for compilation?
I feel like I'm spamming the forum a bit.
Also I would've posted in the Libraries section, but posts here and in General in my experience seem to get answered to a lot more quickly/get answered to at all :).