Happy Codings - Programming Code Examples
Html Css Web Design Sample Codes CPlusPlus Programming Sample Codes JavaScript Programming Sample Codes C Programming Sample Codes CSharp Programming Sample Codes Java Programming Sample Codes Php Programming Sample Codes Visual Basic Programming Sample Codes


C++ Programming Code Examples

Learn C++ Language

getimage() Function in C++ Programming Language

getimage() Function in C++
getimage() function copy a specific portion into memory. This specific image would be any bit image like rectangle, circle or anything else. getimage() copies an image from the screen to memory. Left, top, right, and bottom define the screen area to which the rectangle is copied. Bitmap points to the area in memory where the bit image is stored. The first two words of this area are used for the width and height of the rectangle; the remainder holds the image itself.
Syntax for getimage() Function in C++
#include <graphics.h> void getimage(int left, int top, int right, int bottom, void *bitmap);
left
X coordinate of top left corner
top
Y coordinate of top left corner
right
X coordinate of bottom right corner
bottom
Y coordinate of bottom right corner
bitmap
points to the area in memory where the bit image is stored getimage() function saves a bit image of specified region into memory, region can be any rectangle. This function does not return any value.
/* getimage() function code example copies an image from the screen to memory. */ /* save a bit image of the specified region displayed on the screen into memory by getimage() function code example. */ #include<stdio.h> #include<conio.h> #include<graphics.h> void main() { int gd=DETECT, gm,size; char *buff; initgraph(&gd,&gm," "); outtextxy(100,80,"Original image:"); rectangle(100,200,200,275); size=http://www.web.com/imagesize(100,200,200,275); buf=malloc(size); getimage(100,200,200,275,buf); outtextxy(100,320,"Captured image:"); putimage(100,340,buf,COPY_PUT); getch(); closegraph(); }


The "goto statement" is used for transferring the control of a program to a given label. The syntax of goto statement looks like this: In a C++ program, we have any "number of goto"