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 background color

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
Dennis445a Posted - Jul 17 2024 : 14:31:52
I am trying to set the background color of a layer.

I have tried:

PreView.currentlayer.FillColor := BWColorPicker.SelectedColor; //nothing changes
PreView.Background := BWColorPicker.SelectedColor; //This works for the base background color

I would like to change the default layer from white to a user select color as the fill color.

What am I missing?

dm
4   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Jul 18 2024 : 16:52:51
Sorry, I misunderstood your usage. If the layer is an image, then you need to edit it using image methods. The color properties of layers only apply to vector layers.

FillColor is just a shortcut method to the actual properties of the relevant layer types, it has no effect for TIEImageLayers. Please see the details at:

http://www.imageen.com/help/TIELayer.FillColor.html

Nigel
Xequte Software
www.imageen.com
Dennis445a Posted - Jul 18 2024 : 11:26:14
Okay, so it turns out I had to use PreView.Proc.fill(BWColorPicker.SelectedColor);
as this is a flood fill.

So it adds to the question as to why I need to do it this way as apposed to picking a layer to fill the background? And why the other way doesn't work?

dm
Dennis445a Posted - Jul 18 2024 : 09:36:19
procedure TBWCSBF.BWColorPickerChange(Sender: TObject);
begin
PreView.currentlayer.FillColor := BWColorPicker.SelectedColor; //Nothing happens with this
PreView.FillTool.ColorFillValue := BWColorPicker.SelectedColor;// This works when using the bucket fill tool
PreView.Background := BWColorPicker.SelectedColor; //This works for the background
PreView.Update();//I used this before as well without the '()' and it didn't work.
end;

I have tried it with this as well and still not working, however the bucket fill works as expected. I tried this with a blank project with only a color button and ImageEnView component with the code firing on the button's on change event and the results are the same.

One last thing, this is the default layer[0] created by ImageEnView at startup. I have also tried adding layers and the result with the layer background color is the same, it doesn't change.

Anyone have any additional ideas?

dm
xequte Posted - Jul 18 2024 : 00:57:01
Hi

Make sure you call ImageEnView1.Update() after modifying layer properties.

Nigel
Xequte Software
www.imageen.com