Le 20/11/2011 15:50, Maurice Lombardi a écrit :
Le 20/11/2011 09:39, Hartmut Schirmer a écrit :
Oops, in addition bits are organized in a different order. Please experiment by changing colors with the following program (augmented from the demo program GetImage.pas of BP) It runs identically in BP and in gpc/grx under djgpp ---------------------------------------------------------------------------- {Getimage.PAS} program test; {Sample code for the GetImage procedure.}
uses Graph;
var Gd, Gm: Integer; P: ^Byte; Size: Word; f: File; begin Gd := Detect; InitGraph(Gd, Gm, 'C:\BP\BGI'); if GraphResult <> grOk then begin Writeln('Graphics error'); Readln; Halt(1); end; SetFillStyle(SolidFill,Green); Bar(0, 0, GetMaxX, GetMaxY); Size := ImageSize(10, 20, 30, 40); GetMem(P, Size); { Allocate memory on heap } GetImage(10, 20, 30, 40, P^); assign(f,'IMAGE.GRE'); Rewrite(f,1); BlockWrite(f,P^,Size); Close(f); Writeln(Size); Readln; ClearDevice; PutImage(100, 100, P^, NormalPut); Readln; CloseGraph; end. --------------------------------------------------------------------------
Good luck
Maurice