ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 AddNewObject Help
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

bryl

USA
1 Posts

Posted - Sep 03 2015 :  09:46:04  Show Profile  Reply
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;

xequte

39053 Posts

Posted - Sep 03 2015 :  15:10:21  Show Profile  Reply
Hi

There is nothing wrog with this code, but are you sure you are not processing images that have already been processed before (adding a red box to an image that aleady has a red box)?


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

chunhua

China
5 Posts

Posted - Jan 11 2016 :  08:30:11  Show Profile  Reply
hi
I am use LayersAdd(1,1,ie24RGB,0,8) function on delphi 7,but error message:Underclared indentifier:ie24RGB

xxx
Go to Top of Page

w2m

USA
1990 Posts

Posted - Jan 11 2016 :  08:37:31  Show Profile  Reply
It is simple as copying ie24RGB to the clipboard, then open the help file, paste ie24RGB into the help search tab and select List. The very first item found is TIEPixelFormat. Click on TIEPixelFormat and the help appears which shows that TIEPixelFormat is defined in hyieutils.pas. The unit is always shown as the first line... in this case... ImageEn, unit hyieutils.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: