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
 Paint Annotations on an ImageenView
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

john_siggy@yahoo.com

USA
138 Posts

Posted - Nov 16 2017 :  11:32:21  Show Profile  Reply
I am trying to paint rectangular annotations from an ImageEnVect to an ImageEnView. Location and Size of the rectangles is wrong. Thanks in advance.


Code:



Mult := ImageEnView1.Bitmap.Height / ImageEnVect2.Bitmap.Height; {wrong}
for i := 0 to ImageEnVect2.ObjectsCount - 1 do
begin
with ImageEnView1.GetCanvas do
begin
Pen.Color := Colors[1];
Pen.Width := 2;
Brush.Style := bsClear;
Rectangle(
Round(ImageEnVect2.ObjLeft[i] * Mult),
Round(ImageEnVect2.ObjTop[i] * Mult),
Round(ImageEnVect2.ObjRight[i] * Mult),
Round(ImageEnVect2.ObjBottom[i] * Mult))
end;
end;

john_siggy@yahoo.com

USA
138 Posts

Posted - Nov 16 2017 :  14:51:43  Show Profile  Reply
Found the answer:
Rectangle(
ImageEnView1.Xbmp2Scr(ImageEnVect1.ObjLeft[i]),
ImageEnView1.Ybmp2Scr(ImageEnVect1.ObjTop[i]),
ImageEnView1.Xbmp2Scr(ImageEnVect1.ObjRight[i]),
ImageEnView1.Ybmp2Scr(ImageEnVect1.ObjBottom[i]));
);
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: