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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Layer errors

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
PeterPanino Posted - Dec 09 2022 : 04:26:22
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?



1   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Dec 09 2022 : 21:52:51
Hi

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

Nigel
Xequte Software
www.imageen.com