Jump to content
Software FX Community

Releasing chart image files and changing image mode


Recommended Posts

1. I set a chart background image programmtically. I then change it to another image. I then change it back to the first image but it seems the file is locked. I am assigning the imagebackground on the same chart object each time. I would have thought that each time a background image is changed then the file used to create it is released?

2. Also, when my code changes the image mode (from tile to watermark etc) nothing changes in the chart.

I am using .bmp images.

Link to comment
Share on other sites

1) How are you passing the image to the chart background? as an image object? If so, we don't have the file and wi will not Dispose of the Image object since it was given by you and you may be using it somewhere else.

2) What code are you using to change this? Did you try calling Chart.Refresh()?

Link to comment
Share on other sites

Thanks for quick reply.

1) The code is

ChartFX.WinForms.Adornments.ImageBackground i =

new ChartFX.WinForms.Adornments.ImageBackground(<string location>);foreach (Chart c in Global.Charts.Values)


c.Background = null;

c.Background = i;


Should I pass an Image object rather than a path?

2) Yes, I was just about (honest) to post back that .Refresh() fixes that. Apologies.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...