Re: Loading A Graphic Using CxImage From User Input

new topic     » goto parent     » topic index » view thread      » older message » newer message
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

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu