Problem with transparency when generating PNG images.

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
zur003
Newbie
Newbie
Posts: 4
Joined: Mon Nov 20, 2006 12:00 am

Problem with transparency when generating PNG images.

Post by zur003 » Tue Nov 28, 2006 4:32 am

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Nov 29, 2006 1:56 pm

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
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

zur003
Newbie
Newbie
Posts: 4
Joined: Mon Nov 20, 2006 12:00 am

Post by zur003 » Thu Nov 30, 2006 12:13 am

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Nov 30, 2006 9:52 am

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;
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

pbilka
Newbie
Newbie
Posts: 2
Joined: Tue Mar 13, 2007 12:00 am
Contact:

transparency

Post by pbilka » Tue Jan 29, 2008 5:24 am

Hey, guys,

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

Hope this helps...

Peter

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Jan 29, 2008 11:09 am

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply