1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
VAR
Graphmode : INTEGER;
Graphpilot : INTEGER;
ModeInf,ModeSup : INTEGER;
Fichier : FILE ;
p_image : POINTER;
x1,y1,x2,y2 : INTEGER
BEGIN
{init gaphic mode}
Graphpilot:= Detect;
InitGraph(Graphpilot, Graphmode, '');
GetModeRange(GraphPilot, ModeInf, modeSup);
SetGraphMode(ModeSup);
{do somethings with graphics}
{save the image in a file}
GetMem(p_image, ImageSize(x1, y1, x2, y2));
GetImage(x1, y1, x2, y2, p_image^);
Assign (Fichier, 'image.img');
Rewrite (Fichier, 1);
BlockWrite(Fichier, p_image^, ImageSize(x1, y1, x2, y2));
Close (Fichier);
FreeMem(p_image, ImageSize(x1, y1, x2, y2));
END; |