Re: Loading A Graphic Using CxImage From User Input
- Posted by ghaberek (admin) Jun 23, 2009
- 1313 views
Andy said...
I made some changes to the code, but it is still crashing. Here's the code
(see below)
What am I doing wrong?
atom HeroWalk_Gfx HeroWalk_Gfx = 0 procedure Add_Hero_WalkGfx(integer self, integer event, sequence parm) fName = getOpenFileName(EDWin,file,GraphicType) if length(fName) = 0 then return end if HeroWalk_Gfx = CXI_LoadImage(fName,GraphicType,0) HeroWalk_Gfx = createDIBFromCXImage(HeroWalk_Gfx) repaintWindow( Main ) end procedure setHandler(Hero_WalkGfx_Add,w32HClick,routine_id("Add_Hero_WalkGfx")) procedure EDWin_onPaint(integer self, integer event, sequence parm) if HeroWalk_Gfx != 0 then copyBlt(EDWin,710,220,HeroWalk_Gfx) end if end procedure setHandler(EDWin,w32HPaint,routine_id("EDWin_onPaint"))
-Greg