1. Bitmap File Not Working
- Posted by Lone_EverGreen_Ranger Dec 06, 2010
- 1194 views
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"))
2. Re: Bitmap File Not Working
- Posted by ArthurCrump Dec 06, 2010
- 1168 views
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
3. Re: Bitmap File Not Working
- Posted by Lone_EverGreen_Ranger Dec 06, 2010
- 1146 views
Ok that works and it dosen't work. It still isn't showing the graphic on the window.