You are here

imagesize function in c

imagesize function returns the number of bytes required to store a bitimage. This function is used when we are using getimage.

Declaration:- unsigned int imagesize(int left, int top, int right, int bottom);

C programming code for imagesize

  1. #include <graphics.h>
  2. #include <conio.h>
  3.  
  4. main()
  5. {
  6.    int gd = DETECT, gm, bytes;
  7.    char array[100];
  8.  
  9.    initgraph(&gd, &gm, "C:\\TC\\BGI");
  10.  
  11.    circle(200, 200, 50);
  12.    line(150, 200, 250, 200);
  13.    line(200, 150, 200, 250);
  14.  
  15.    bytes = imagesize(150, 150, 250, 250);
  16.    sprintf(array, "Number of bytes required to store required area = %d", bytes);
  17.    outtextxy(10, 280, array);
  18.  
  19.    getch();
  20.    closegraph();
  21.    return 0;
  22. }