1. Image Input Not Showing

Hello,

I keep getting an error everytime I try to load the image into the window. The code for the window is not shown here, but the program works up until I try to load a image. It gets type_check failure. It appears to be coming from cximage.ew, but I don't think that is the case. Bascilly when I try to load the image, the program crashes. I'm wondering if there is something I'm doing wrong with my code. I can show more code if it is needed.

 
atom game_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,ImageType,0) 
	 
	game_image = createDIBFromCXImage(game_image) 
	 
	repaintWindow(Image_Win) 
 
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     » topic index » view message » categorize

2. Re: Image Input Not Showing

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.

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

3. Re: Image Input Not Showing

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.....}

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

4. Re: Image Input Not Showing

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 message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu