Hello Everybody , i'm new in c++ and i just want to know the function that flips the screen from the right to the left (like The Mirror), please try to reply as fast as you can
Hello Everybody , i'm new in c++ and i just want to know the function that flips the screen from the right to the left (like The Mirror), please try to reply as fast as you can
As far as I know, there is not such a function. Is it a DOS console? You could read in all characters on the screen in an array and print them out in reverse order...
MagosX.com
Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime.
and how can i do it in an array ?
i think it's possible with far pointers
couldn't find any single function that would do this.
sorry i could not be of any help.maybe i need better books
magos, sungod , thnx for interesting really appreciate it , but i really need something that does that screen flipping
Anyone Knows ?
I've got little experience in PC graphics and only DOS. As far as I know there the pixels of the screen are stored in the video memory. You can access the video memory and if you know the height and width, you can flip the screen by exchanging pixels on the lines.
(x[0],y[n]) -> (x[i],y[n])
Here x[0] is the most left pixel and x[i] the most right pixel. Exchanging the pixels in this case means that the most left pixel is exchanged by the most right pixel. Then you have to do the next pixel
(x[1],y[n]) -> (x[i-1],y[n])
And so on and for each line. Hope it's a little bit clear. But first you have to know how to reach the video memory, if required ofcourse. I know that many graphics chips store more than one page in memory. You could read such a page, flip it and then put it on the screen.
how are u today?
i think that what u want is too easy that u can put ur words in array of char then make 2 pointers one points to the first element array[0] , and another points to the last element in the array ,array[n-1] ,
and then swap between the first and the last pointers and so on......................
dr_mysterious
are you trying to flip the console? Basically IF you had everything stored in a 2D array you just do what everyone said. Just think of your screen as a 10x10 matrix (or whatever size you want) and then think of the algorithm for flipping each part of that matrix. You can store the new parts into a new 10x10 matrix or whatever.
Basically that is the idea that everyone is trying to explain to you. If you wanted to reverse more than just text then maybe the suggestion by shiro would be more towards what you want. However again it is the same idea.
If u r a beginner in c++, the easiest way to do it is just to store all data on the screen in an array and put it on the screen again backwards. Easy... But I can't think of a standard single function that can do anything like that
Ok , There You A Demonstartion For What i Need , Please i need some help
This is a little program that mirrors the text on screen. I don't know if these are standard functions or not.
Code:#include <conio.h> #include <iostream.h> int main() { char buffer[4096]; //*** Input whatever text you want here *** getch(); gettext(1, 1, 80, 25, buffer); clrscr(); for(int y=0; y<25; y++) { for(int x=79; x>=0; x--) { if(y!=24 || x!=0) { cout << buffer[(y*80+x)*2]; } } } getch(); return 0; }
Last edited by Magos; 04-03-2002 at 04:43 PM.
Magos , Really Really Really Thanx About This Code , Now i want to make the user enter the array of characters he wants and then the screen flips it. Can You ?
i'll be more Greetfull
Put whatever cout-statement you want where I wrote:
//*** Input whatever text you want here ***
Simple, huh?
If you want the user to do this in real-time, you have to try by yourself this time .
MagosX.com
Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime.