Note: You must be registered in order to post a reply. To register, click here. Registration is FREE!
T O P I C R E V I E W
PeterPanino
Posted - Sep 24 2020 : 14:18:40 Is there a built-in method to create a new image from the current layer (Containing only the layer image)? Or do I have to code it myself? (I don't want to reinvent the wheel).
4 L A T E S T R E P L I E S (Newest First)
xequte
Posted - Sep 25 2020 : 05:44:09 Hi
Non-image layers may need to be handled differently. I'll need to check that when I'm back in the office next week.
In the meantime you might try using CopyToBitmap rather than assigning the bitmap.
I still have a question about the quality of the result. This is the source text-layer with a Heart shape:
And this is the result after the above operation:
You can clearly see that the curved part of the result has massive imperfections. (Also the text seems to be made from a Sawtooth font). Are these imperfections a result of rounding errors or of aliasing effects or of something else? Is it possible to obtain a perfect curved line?
xequte
Posted - Sep 24 2020 : 17:56:27 Hi
You can probably simplify it like this (untested):
Posted - Sep 24 2020 : 15:12:55 I've come up with this code:
procedure TForm.mCreatenNewImageFromTextLayerClick(Sender: TObject);
var
b: TIEBitmap;
i: Integer;
begin
b := TIEBitmap.Create;
try
ImageEnView1.Layers[idx].CopyToBitmap(b);
ImageEnView1.IEBitmap.Assign(b);
ImageEnView1.Update;
for i := ImageEnView1.LayersCount - 1 downto 1 do
ImageEnView1.LayersRemove(i);
finally
b.Free;
end;
end;