Page 1 of 1

Problem with transparency when generating PNG images.

Posted: Tue Nov 28, 2006 4:32 am
by 9348127
Hi,

I've only recently upgraded to TeeChart Professional 7 (with source code), and have run into what appears to be a bug. Here's some background: my application saves .png and .tee files of charts. The .png files are then embedded within reports displayed using a Web browser window in my application, but I allow the user to edit these images by clicking on them in the browser. This triggers an editing dialog which operates on the corresponding .tee file. This all works fine. The problem I'm seeing occurs with charts which include a TColorBandTool with a transparency of 80, which I use to create backgrounds on these charts. When the user saves a chart to png format from the dialog, these color bands use solid color, not transparency.

Since I have the source code version, I've been able to look into this a bit, and I found that removing the line in CustomTeePanel.NonBufferDraw which sets IKeepBitmap to true corrects the problem.

Is this a known bug? Should I try to provide you with a simpler example?

Thanks,

Eric Zurcher
CSIRO Plant Industry
Canberra, Australia

Posted: Wed Nov 29, 2006 1:56 pm
by narcis
Hi Eric,

Yes please, send us a simple example we can run "as-is" to reproduce the problem here.

You can post your files at news://www.steema.net/steema.public.attachments newsgroup.

Thanks in advance

Posted: Thu Nov 30, 2006 12:13 am
by 9348127
OK. I've posted a very simple example to the steema.public.attachements newsgroup. Look for the subject line: Problem with transparency when generating PNG images - sample image and code

Posted: Thu Nov 30, 2006 9:52 am
by narcis
Hi Eric,

Thanks for the example. It also works fine here setting BufferedDisplay to true:

Code: Select all

procedure TForm2.Open1Click(Sender: TObject);
begin
  OpenDialog1.Title := 'Open tee file';
  OpenDialog1.Filter := 'Tee (*.tee)|*.tee';
  OpenDialog1.FilterIndex := 1;
  if OpenDialog1.Execute then
  begin
    Chart1.Align := alNone;
    LoadChartFromFile(TCustomChart(Chart1), OpenDialog1.FileName);

    self.ClientHeight := Chart1.Height + TeeCommander1.Height;
    self.ClientWidth := Chart1.Width;
    Chart1.Align := alClient;
  end;

  Chart1.BufferedDisplay:=false;
  Chart1.CopyToClipboardBitmap;
end;

transparency

Posted: Tue Jan 29, 2008 5:24 am
by 9244521
Hey, guys,

I can see the same thing, but only when the app generates the image file when minimized.

Hope this helps...

Peter

Posted: Tue Jan 29, 2008 11:09 am
by narcis
Hi Peter,

Could you please let us know the TeeChart version you are using and send us a simple example project we can run "as-is" to reproduce the problem here?

You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

Thanks in advance.