RE: get_pixel() troubles
- Posted by dstanger at belco.bc.ca Jun 12, 2001
- 311 views
Thomas Parslow (PatRat) wrote: > > hi, > > > I am trying to us get_pixel() but -1 keeps being returned and I finally > > get > > an error telling me that there is a type check failure and that c = -1. > > I am > > refered to graphics.e. c is used as a variable there but is not present > > in > > my program. > > Any suggestions as to what is going on? > > > David S > > This is in a DOS (.ex) program right? > > Could you send the bit of code that is causing this error? > > Thomas Parslow (PatRat) ICQ #:26359483 > Rat Software > http://www.rat-software.com/ > Please leave quoted text in place when replying > > Hi there, Yes this is DOS program. Here is the code that is puzzling me: atom n n = graphics_mode(18) atom r, g, b, height, width, len object x, current_color sequence vc, colors colors = {} --Checks what graphics mode is being used. vc = video_config() --Pass the results to an object. x = vc[2] --If mode 1, 2, or 3 is being used an error results as they are for --text only. if x <=3 then puts(1, "ERROR! MUST BE IN PIXEL GRAPHICS MODE TO WORK!") abort(0) else width = vc[5] --Otherwise the width and height of the screen is obtained height = vc[6] end if --Here the screen is "scanned" with the color of each pixel being stored --in a sequence. for y_pix = 0 to height do for x_pix = 0 to width do colors = append(colors, get_pixel({width, height})) end for end for Any ideas? The error seems to be produced in graphics.e during a machine_proc(). I'm stumped! Any help would be greatly appreciated, David S