1. Bitmap File Not Working

Hello. All I am trying to do is load a bitmap file onto the window, however it is not working. I'll post my code.

 
atom HeroWalk_Gfx 
sequence file 
 
procedure Load_HeroWalkGfx(integer self, integer event, sequence parm) 
	 
	fName = getOpenFileName(EDWin,file,GfxType) 
	 
	if length(fName) = 0 then 
		return 
	end if 
	 
	HeroWalk_Gfx = loadBitmapFromFile(file) 
	 
	if HeroWalk_Gfx != 1 then 
		return 
	end if 
	 
        --the window is declared as a constant 
	drawBitmap(Hero_WalkGfx_Win,HeroWalk_Gfx,0,0) 
	 
        --these are declared as integers 
	if HeroWalk_Frames > 0 then 
		HeroWalk_CurrentFrame = HeroWalk_CurrentFrame + 1 
	elsif HeroWalk_CurrentFrame >= HeroWalk_TotalFrames then 
		HeroWalk_CurrentFrame = 1 
	end if 
	 
end procedure 
setHandler(Hero_WalkGfx_Load,w32HClick,routine_id("Load_HeroWalkGfx")) 
 
new topic     » topic index » view message » categorize

2. Re: Bitmap File Not Working

Lone_EverGreen_Ranger said...

Hello. All I am trying to do is load a bitmap file onto the window, however it is not working. I'll post my code.

 
atom HeroWalk_Gfx 
sequence file 
 
procedure Load_HeroWalkGfx(integer self, integer event, sequence parm) 
	 
	fName = getOpenFileName(EDWin,file,GfxType) 
	 
	if length(fName) = 0 then 
		return 
	end if 
	 
	HeroWalk_Gfx = loadBitmapFromFile(file) 
	 
	if HeroWalk_Gfx != 1 then 
		return 
	end if 
	 
        --the window is declared as a constant 
	drawBitmap(Hero_WalkGfx_Win,HeroWalk_Gfx,0,0) 
	 
        --these are declared as integers 
	if HeroWalk_Frames > 0 then 
		HeroWalk_CurrentFrame = HeroWalk_CurrentFrame + 1 
	elsif HeroWalk_CurrentFrame >= HeroWalk_TotalFrames then 
		HeroWalk_CurrentFrame = 1 
	end if 
	 
end procedure 
setHandler(Hero_WalkGfx_Load,w32HClick,routine_id("Load_HeroWalkGfx")) 
 

Two possibilities:

1) Put the drawBitmap in a repaint procedure. 
    or, assuming that you want fname rather than file: 
2) Use the procedure call: 
    setBitmap(Hero_WalkGfx_Win,fname) 
    instead of the section from loadBitmapFromFile to drawBitmap. 
I have not tried your example, so I may have missed something.

Arthur

new topic     » goto parent     » topic index » view message » categorize

3. Re: Bitmap File Not Working

Ok that works and it dosen't work. It still isn't showing the graphic on the window.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu