Posts
Showing posts from March, 2018
putpixel in c
- Get link
- X
- Other Apps
Function name - putpixel Definition- putpixel is used to plot a dot on screen at specified position with specified colour. sy ntax- putpixel(int x,int y,pixelcolor); Example c program for putpixel- #include<graphics.h> #include<conio.h> void main() { int gd=DETECT, gm; clrscr(); initgraph(&gd,&gm,"c:\\turboc3\\bgi"); putpixel(20,30,4); getch(); closegraph(); } Output- As you can see red colour dot is placed at (20,30) position.
- Get link
- X
- Other Apps
Text Mode in C- In text mode, the text screen is divided into cells with a width of 40 or 80 columns and height of 25, 43 or 50 lines or rows. In a screen of 80×25 there will be total 2000 cells. Every cell used for display consists of two things, one is the character to be displayed and the other is attribute associated with it. Here the attribute is just a colour, intensity etc. Considering the following figure of resolution 80×25, the following gives the look of 80 columns and 25 lines or rows. In above screen 80 characters can be displayed at a time, such that there are 25 lines so that total 2000 (80×25) characters can be displayed at a time. The co-ordinate of left upper corner is (1,1). And the right upper corner is (80,1). In general comparison (x,y) x indicates the column numbers from left to right and y indicates the rows or line number from top to bottom. Here, the co-ordinate of bottom left corner is (1,25) and the bottom right corner is (80,25).