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
 Layer errors
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

PeterPanino

981 Posts

Posted - Dec 09 2022 :  04:26:22  Show Profile  Reply
I create a Text Layer with this code:

procedure TForm1.ButtonClick(Sender: TObject);
begin
  ImageEnView1.LayersAdd(
    ' Caption',
	  12,
	  clYellow,
	  'Arial'
	  );
	TIETextLayer(ImageEnView1.CurrentLayer).PosX := 0;
	TIETextLayer(ImageEnView1.CurrentLayer).PosY := ImageEnView1.IEBitmap.Height;
	TIETextLayer(ImageEnView1.CurrentLayer).Layout := ielCenter;
	TIETextLayer(ImageEnView1.CurrentLayer).Width := ImageEnView1.IEBitmap.Width;
	TIETextLayer(ImageEnView1.CurrentLayer).Height := 50;
	TIETextLayer(ImageEnView1.CurrentLayer).BorderWidth := 0;
	TIETextLayer(ImageEnView1.CurrentLayer).FillColor := clYellow;
	TIETextLayer(ImageEnView1.CurrentLayer).Locked := True;
        ImageEnView1.LayersMerge(True);
	TIETextLayer(ImageEnView1.CurrentLayer).Update;

  StatusBar.SimpleText :=
    'Width: ' + IntToStr(ImageEnView1.IEBitmap.Width) +
    ', Height: ' + IntToStr(ImageEnView1.IEBitmap.Height);
end;


This results in the following errors:

1. One pixel is missing on the right side:



2. One Pixel is missing on the bottom (Height should be 100):



Here is the source code (please put the file TestImage.bmp into the directory with the exe file):

attach/PeterPanino/202212941448_LayerInaccuracies.zip
2.43 KB

Questions:

1. Is it enough to add 1 pixel to the Layer width and 1 pixel to the Layer height to compensate for these errors?

TIETextLayer(ImageEnView1.CurrentLayer).Width := ImageEnView1.IEBitmap.Width + 1;
TIETextLayer(ImageEnView1.CurrentLayer).Height := 50 + 1;


2. Could these errors add up to higher values in some circumstances?



xequte

39052 Posts

Posted - Dec 09 2022 :  21:52:51  Show Profile  Reply
Hi

There appears to be a drawing issue there. Please email me for an update.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: