LoadAnimImage

BlitzMax Forums/BlitzMax Programming/LoadAnimImage

Gavin Beard(Posted 2008) [#1]
Hi all,

I am trying to load this image: using:
local fntImage:TImage;
fntImage = LoadAnimImage ("digits.png",26,32,0,12,FILTEREDIMAGE);

While Not KeyDown(key_escape)
	Cls
		drawimage fntImage (fntImage,10,10);
	Flip
Wend


But this gives error saying i am trying to access a null object, however if i use:

fntImage = LoadImage ("digits.png");


it works fine, is there any particular reason this may occur?


Gavin Beard(Posted 2008) [#2]
most strange, deleted the line of code, and pasted it back in and it works :-S


Digital Anime(Posted 2008) [#3]
Check drawimage command, it should be : drawimage (image,x,y,frame)

try this :

Graphics 120,80,0
Global fntImage:TImage
fntImage = LoadAnimImage ("digits.png",26,32,0,12,FILTEREDIMAGE)

Global frame:Int = 0
While Not KeyDown(key_escape)
	Cls
		DrawImage  fntImage,10,10,frame
		frame = frame + 1
		If frame = 12 Then frame =0
	Flip
	WaitKey
Wend



Gavin Beard(Posted 2008) [#4]
:-D

sorry typo, twas there originally, original problem was it not loading the image, but as i say removing and adding the code did it :-S