Hello Forum,
I have a problem with the following code where the resulting image is suppose to have a red box shown at the given location but sometimes there are multiple boxes drawn at varing sizes. I think it is due to the jpeg compression but i'm not sure how to take the resulting jpeg image and output it in a loss less format.
Could someone help me with these 2 issues?
Thank you!
Function AddInfoBlock(photo, txt1, txt2,txt3: string): boolean;
var TS: integer;
begin
with frmmain.ImageEnVect1 do begin
IO.LoadFromFileJpeg(photo);
LayersAdd(IO.Bitmap.Width ,strtoint(getini('Printer','BoxHeight','60'))
,ie24RGB,0,IO.Bitmap.height);
// White fill the new layer
Proc.Fill(CreateRGB(255, 255, 255));
// Output our text
TS:=strtointdef(getini('Printer','FontSize','12'),12);
Proc.TextOut(0, 0, txt1, 'Arial', TS, clBlack, [fsBold]);
Proc.TextOut(0, 20, txt2, 'Arial', TS, clBlack, [fsBold]);
Proc.TextOut(0, 40, txt3, 'Arial', TS, clBlack, [fsBold]);
//put redical on image
ObjKind[-1] := iekBOX; //iekLINE;
ObjLeft[-1] := trunc(strtoint(getini('lidar','LidarX','0' )) );
ObjTop[-1] := trunc(strtoint(getini('lidar','LidarY','0' )) );
ObjWidth[-1] := trunc(strtoint(getini('lidar','LidarW','150')) );
ObjHeight[-1] := trunc(strtoint(getini('lidar','LidarH','150')) );
ObjPenColor[-1] := clRed;
AddNewObject; ///sometimes results in a ladder or several blocks should just be one square
// Merge layer into main window
LayersMergeAll;
IO.SaveToFileJpeg(photo);
//IO.SaveToFilePNG(photo);
end;
end;