Hi, the problem looks to be that when you created the header, you put the data in as uintegers, instead of by bytes, and got the order the wrong way around.
This program should show this, look where it prints out p[0], p[1], p[2], p[3], they are in the wrong order.
I did some quick hacky code to reverse them, and it almost looks ok.
Code: Select all
#include "fbpng.bi"
#include "fbgfx.bi"
screenres 640, 480, 32
dim as fb.image ptr font = png_load( "dejavu20uf1.png", PNG_TARGET_FBNEW )
dim as ubyte ptr p = cast( ubyte ptr, font ) + sizeof( fb.image )
print p[0]
print p[1]
print p[2]
print p[3]
p[0] = 0
p[1] = 32
p[2] = 166
p[3] = 6
p = @p[4]
for i as integer = 0 to (166 - 32) \ 4
asm
mov ecx, dword ptr [p]
mov eax, [ecx]
bswap eax
mov [ecx], eax
end asm
p += 4
next i
sleep
draw string ( 0, 200 ), "WORLD HELLO", , font
sleep