imagesize() function in C
Last Updated :
23 Jan, 2018
The header file graphics.h contains imagesize() function which returns the number of bytes required to store a bit-image.
Syntax :
unsigned int imagesize(int left, int top,
int right, int bottom);
where,
left, top, right, and bottom
define the area of the screen
in which image is stored.
Below is the implementation of imagesize() function.
#include <graphics.h>
#include <stdio.h>
int main()
{
int gd = DETECT, gm, color, bytes;
char arr[100];
initgraph(&gd, &gm, "" );
circle(200, 200, 50);
line(150, 200, 250, 200);
line(200, 150, 200, 250);
bytes = imagesize(150, 150, 250, 250);
sprintf (arr, "Number of bytes required "
"to store required area = %d" , bytes);
outtextxy(20, 280, arr);
getch();
closegraph();
return 0;
}
|
Output :
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...