1. Image Input Not Showing
- Posted by Lone_EverGreen_Ranger Dec 02, 2011
- 1065 views
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"))
2. Re: Image Input Not Showing
- Posted by DerekParnell (admin) Dec 03, 2011
- 1052 views
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.
3. Re: Image Input Not Showing
- Posted by Lone_EverGreen_Ranger Dec 03, 2011
- 1011 views
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.....}
4. Re: Image Input Not Showing
- Posted by Lone_EverGreen_Ranger Dec 03, 2011
- 1005 views
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"))