smc@hwee.UUCP (Stephen McGowan) (02/20/90)
Anyone out there know about Turbo-C graphics pages? I'm using the 0 page (default), but I need to switch to page 1 to display further information from page 0. However, it appears as though I'm not able to address the cursor co-ordinates (or more specifically, move the cursor using the 'gotoxy(x,y)' statement. I can only use this facility if I use the 'textmode()' function which, obviously, will reset my graphics displays on page 0. Funny thing is, I'm able to perform these 'gotoxy' calls if I remain on page 0. However, this has the drawbaxck that it overwrites my graphics displays. So, are the 2 graphics pages (0 and 1) exactly the same? Do they inherit each other's attributes? Is page 0 capable of handling both text and graphics simultaneously, whereas page 1 can only support one mode? (as appears to be the case). To give you some idea of what I want to do, here's a brief decription: Page 0 contains a 256*256 pixel image of a three-dimensional vision scan. I would like to incorporate a facility where the user can move the mouse pointer over a particular horizontal image line, press a mouse button and have the 256 data values for that horizontal line displayed on the screen. As and when the values for this line have been displayed, I want to use the mouse to select further data lines - this is achieved by letting the user move the mouse up and down. As they do so, a counter which is displayed on the screen in the same position (hence the need for the 'gotoxy') is continually updated to reflect the mouse movements; that is, the counter is incremented or decremented between 0 and 255. The subsequent data values are all displayed at the same screen positions (again the need to use 'gotoxy'). Well this is what I'd like to do, but am having problems with page 1 attributes. So does anyone out there have any ideas on what to do, or can possibly answer a few of the questions raised? Thanks. Steve McGowan. (email smc@uk.ac.hw.ee) of page 0, I woul
jseidman@jarthur.Claremont.EDU (James Seidman) (02/21/90)
In article <708@hwee.UUCP> smc@hwee.UUCP (Stephen McGowan) writes: > Anyone out there know about Turbo-C graphics pages? These pages are actually provided by your graphics card, not by Turbo-C. The compiler merely provides routines to access them. > I'm using the 0 page (default), but I need to switch to page > 1 to display further information from page 0. Whether or not a page 1 even exists, by the way, depends on your graphics card, how much memory it has, and what graphics mode you are in. > However, it appears as though I'm not able to address the cursor > co-ordinates (or more specifically, move the cursor using the > 'gotoxy(x,y)' statement. gotoxy() is a text function, yet you're talking about graphics stuff. What you describe later is doing more text. What exactly are you trying to do? > I can only use this facility if I use the 'textmode()' function > which, obviously, will reset my graphics displays on page 0. > > Funny thing is, I'm able to perform these 'gotoxy' calls if I remain > on page 0. However, this has the drawbaxck that it overwrites my > graphics displays. That is a funny thing. What does it do? Since it's supposed to position the text cursor, unless you're using the BGI text outputs it shouldn't have any effect on a graphics screen. > So, are the 2 graphics pages (0 and 1) exactly the same? Do they > inherit each other's attributes? Is page 0 capable of handling > both text and graphics simultaneously, whereas page 1 can only > support one mode? (as appears to be the case). They have identical attributes. They inherit each other's attributes inasmuch as most "attributes" (palette, graphics mode, etc.) are controlled by other registers on the graphics card. It only affects what memory locations are looked at for the graphics data. > Page 0 contains a 256*256 pixel image of a three-dimensional vision > scan. I would like to incorporate a facility where the user can move > the mouse pointer over a particular horizontal image line, press > a mouse button and have the 256 data values for that horizontal > line displayed on the screen... [stuff deleted] You never quite described why you need both graphics pages. By the way, when you change graphics pages, are you remembering to use both setactivepage() and setvisualpage()? Anyway, I would think that you could do what you're describing by using the BGI text output routines to display the stuff below the image. -- ------------------------------------------------------------------------------- Jim Seidman, Harvey Mudd College, Claremont, CA 91711. (714) 621-8000 x2026 DISCLAIMER: I don't even know if these are opinions, let alone those of anyone other than me.
smc@hwee.UUCP (Stephen McGowan) (02/21/90)
In article <708@hwee.UUCP> smc@hwee.UUCP (Stephen McGowan) writes: > > > Anyone out there know about Turbo-C graphics pages? > > I've contacted Borland. Things sorted out. No replies please. Thanks.