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
 Create a new image from the current layer?

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 - 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.

https://www.imageen.com/help/TIELayer.CopyToBitmap.html

Nigel
Xequte Software
www.imageen.com
PeterPanino Posted - Sep 25 2020 : 04:31:10
Amazing!

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):

procedure TForm.mCreateNewImageFromTextLayerClick(Sender: TObject);
begin
  ImageEnView1.Assign( ImageEnView1.CurrentLayer.Bitmap );
  ImageEnView1.LayersClear( False );
end;


Nigel
Xequte Software
www.imageen.com
PeterPanino 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;