Re: Image Input Not Showing

new topic     » goto parent     » topic index » view thread      » older message » newer message
Lone_EverGreen_Ranger said...
DerekParnell said...
Lone_EverGreen_Ranger said...

Hello,

I keep getting an error everytime I try to load the image into the window.

I don't suppose you have the actual error message handy? It does make things a bit easier to debug when we have error messages.

cximage.ew: 309 The error is in function CXI_LoadImage() type_check failure, imagetype is {{73, 109,97, 103,101, 70,105,108,101,115,32,42.....}

EDIT: Nevermind I got. However I do have another problem. I would have it so that I can add multiple images into the same paint window. Like an animation or an array of images. I have a rough draft below. Any help on getting it work, I'd appericate.

integer images = 0 
integer image_count = 0 
integer image_total = 0 
 
integer current_image = 0 
integer next_image = 0 
integer last_image = 0 
 
integer games = 0 
integer current_game = 0 
integer total_games = 0 
 
atom game_image = 0 
 
sequence ImageList = {current_image,next_image,last_image} 
 
procedure LoadImage(integer self, integer event, sequence parm) 
	 
	fName = getOpenFileName(MainWin,file,ImageType) 
	 
	if length(fName) = 0 then 
		return 
	end if 
	 
	game_image = CXI_LoadImage(fName,CXI_FORMAT_UNKNOWN,0) 
	 
	game_image = createDIBFromCXImage(game_image) 
	 
	repaintWindow(Image_Win) 
	 
	images += 1 
	image_total = images 
	current_image = images 
	 
	if current_image > 1 then 
		current_image = ImageList[2] 
		elsif image_total > images then 
			current_image = ImageList[1] 
	end if 
 
end procedure 
setHandler(Image_Add,w32HClick,routine_id("LoadImage")) 
 
procedure PaintWin(integer self, integer event, sequence parm) 
	 
	copyBlt(Image_Win,0,0,game_image) 
 
end procedure 
setHandler(Image_Win,w32HPaint,routine_id("PaintWin")) 
new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu