Page 1 of 1

Exporting 'themed-charts' to WMF, EMF & BMP

Posted: Tue Mar 29, 2005 4:06 pm
by 9336214
Delphi 7, Chart Pro 7.04
When I export a chart to WMF or EMF that is using any theme, I end up getting a black background for the chart:

www.retireneeds.com/files/Chart1.EMF
www.retireneeds.com/files/Chart1.WMF

The exact same chart rendered to a BMP looks like this:

www.retireneeds.com/files/Chart1.BMP

what is the problem with the EMF/WMF exporting that the background of the chart is black? Anyway to fix this?

Thanks
Ed Dressel

Posted: Tue Mar 29, 2005 4:34 pm
by narcis
Hi Ed,

I haven't been able to reproduce the problem here.

I have created an example project doing something similar to the images you posted and this works ok using the latest TeeChart sources we have. I'm going to post this example and it's resulting metafile in the [url]news://www.steema.net/steema.public.attachments[/url] newsgroups. I've used some gradients in the walls and also a GridBand tool on the left axis

There may be slight variations between the version you have an mine but none afecting what you reported.

Could you please play with my project if you can reproduce the problem? If so please save and post it at the newsgroups so that I can reproduce the problem here.

Posted: Tue Mar 29, 2005 5:32 pm
by 9336214
Thanks for the quick response! I sincerely appreciate it. )This has got me a bit stresses as I sold the company on the change and now that I am doing it there may be bugs somewhere).

Your code worked fine. I added the theme support to your demo and the problem reproduced. I posted a reply in the attachment newsgroups altering your source code. Click on a theme and the 'export' button (I added) and look at the Chart.* image files in the directory that the exe file exists in.

If you find the problem, please let me know.

Thanks
Ed Dressel

Posted: Tue Mar 29, 2005 8:50 pm
by 9336214
I found that setting the chart.backwall.transparent := true before creating the WMF fixes the problem for all styles but 'Facts', which doesn't want to work not matter why I attempt to do.

Any thoughts?

Ed Dressel

Posted: Wed Mar 30, 2005 7:42 am
by narcis
Hi Ed,

Thanks for modifying my project.

The problem is with gridbandtool transparency. After using "Facts" theme the transparency is not reset to 0. Obviously wmf/emf does not support "transparent" brush styles (custom Alpha values).

You'll get the same results with all objects, if transparency is not 0, for example: add a TAnnotation tool to chart, set transparency to 50 and annotation tool back color to clBlack. When exported, transparency will be ignored and only black annotation rectangle will be shown.

Some workarounds could be:

- Using different export format (jpeg, png).
- Setting transparency to 0 before exporting.
- In "Facts" case : set GridBandTool (both stripes) transparency to 0.
Example:

Code: Select all

      Band1.Color = clSilver
      Band2.Color = clWhite
This can be done at design time via editor or at runtime via code. Or event at Facts theme level, in code, in ApplyTheme method call.

I have already added your request to our list to be considered for inclusion in future releases.

Posted: Wed Mar 30, 2005 4:42 pm
by 9336214
>I have already added your request to our list to be considered for inclusion in future releases.

Thanks for the timely response.

Just a point of clarification--is this seen as a bug or a feature request? I see it as a bug. Please comment.

Ed Dressel

Posted: Thu Mar 31, 2005 7:37 am
by narcis
Hi Ed,

A missing feature because transparent brushes are not that easy to handle in metafile. In the end, it's just a classification name, so it can also be considered a bug, but fixing/implementing it is not an easy task.