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 background color
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

Dennis445a

Canada
10 Posts

Posted - Jul 17 2024 :  14:31:52  Show Profile  Reply
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

xequte

38418 Posts

Posted - Jul 18 2024 :  00:57:01  Show Profile  Reply
Hi

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

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

Dennis445a

Canada
10 Posts

Posted - Jul 18 2024 :  09:36:19  Show Profile  Reply
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
Go to Top of Page

Dennis445a

Canada
10 Posts

Posted - Jul 18 2024 :  11:26:14  Show Profile  Reply
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
Go to Top of Page

xequte

38418 Posts

Posted - Jul 18 2024 :  16:52:51  Show Profile  Reply
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
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: