How to make a TSurfaceSeries show transparent ?

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
niotronic
Newbie
Newbie
Posts: 14
Joined: Mon Jul 15, 2013 12:00 am

How to make a TSurfaceSeries show transparent ?

Post by niotronic » Sat Jun 14, 2014 5:21 pm

Hello,

I would like to display XZ and YZ planes that can be moved across the chart in order to act as an object cutting plane. These planes should be semitranparent so that the main object which is also a TSurfaceseries is visible independent of the position of the XZ and YZ planes. How can I make a TSurfaceSeries semitransparent ? - Simply setting the "tranparency" to a value >0 makes the corresponding SurfaceSeries completely invisble - setting "transparency" to 0 makes it fully intransparent.
Is there any other property to set to enable transparency ?

Code: Select all

  
//This is the main surface (intransparent)
      FSurfaceSeries:=TSurfaceSeries(AddSeries(TSurfaceSeries));
      FSurfaceSeries.PaletteStyle:=psRainbow;
      FSurfaceSeries.UseColorRange:= false;
      FSurfaceSeries.UsePalette:= true;
      FSurfaceSeries.IrregularGrid:= true;


 //FXZPlane and FYZPlane should be semitransparent

      FXZPlane:=TSurfaceSeries(AddSeries(TSurfaceSeries)); 
      FXZPlane.IrregularGrid:=true;
      FXZPlane.Transparency:=50;

      FYZPlane:=TSurfaceSeries(AddSeries(TSurfaceSeries));
      FYZPlane.IrregularGrid:=TRUE;
      FYZPlane.Transparency:=50;

Best regards,

Klaus

Yeray
Site Admin
Site Admin
Posts: 9514
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: How to make a TSurfaceSeries show transparent ?

Post by Yeray » Mon Jun 16, 2014 8:41 am

Hi Klaus,

What TeeChart version are you using?
Here with v2014.11 this seems to work fine for me:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
begin
  with Chart1.AddSeries(TSurfaceSeries) as TSurfaceSeries do
  begin
    FillSampleValues;
    Transparency:=50;
  end;
end;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

niotronic
Newbie
Newbie
Posts: 14
Joined: Mon Jul 15, 2013 12:00 am

Re: How to make a TSurfaceSeries show transparent ?

Post by niotronic » Mon Jun 16, 2014 1:31 pm

Dear Yeray,

I'm using FMX-VCL 2014 which was obviously created on May 12 , 2014 with DELPHI XE6. I tested your example you sent me as a reply to my other post regarding the OnClick / OnMouseDown events, where transparaency is working as expected. But unfortunately it's still not working in my application. As I already said if transparency=0 the SurfaceSeries are visible, if transparency>0 it's completely invisble. Attached you can find the form to reproduce the problem. In the FormCreate method please enable the transparency settings and you will see two surface series becoming invisible....

Best regards,

Klaus
Attachments
View3D.zip
(3.39 KiB) Downloaded 787 times

Yeray
Site Admin
Site Admin
Posts: 9514
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: How to make a TSurfaceSeries show transparent ?

Post by Yeray » Tue Jun 17, 2014 10:14 am

Hi Klaus,

I see you create three TSurfaceSeries but none is populated at the time of the creation of the form.
And when I move one of the scrollbars, I get an OutOfMemory exception.
This is what I've done to run your form. Please correct me if I did anything wrong:
- Create a new "VCL Forms Application - Delphi" in XE6
- Add your form to the project
- Remove the unit "ColorDisplay" from the uses clause and any reference to TColorDisplay.
- Open the Project1.dpr source and change the line:

Code: Select all

Application.CreateForm(TForm1, Form1);
for this to use your form:

Code: Select all

Application.CreateForm(TFView3D, Form1);
- Open your dfm as text and remove the line

Code: Select all

  FormStyle = fsMDIChild
To avoid an error complaining that the project isn't MDI:
Project Project1.exe raised exception class EInvalidOperation with message 'Cannot create form. No MDI forms are currently active'.
It would be better if you could arrange a simple example (but self running) project we can run as-is to reproduce the problem here.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

niotronic
Newbie
Newbie
Posts: 14
Joined: Mon Jul 15, 2013 12:00 am

Re: How to make a TSurfaceSeries show transparent ?

Post by niotronic » Tue Jun 17, 2014 2:55 pm

Dear Yeray,

sorry for that - I forgot to check the zip file - there were some more files missing. Please find attached the complete project. To open the 3DView form select File --> Grab.
To enable transparency (but it still does not show transparent) please activate the appropriate code lines in the FormCreate method of the 3DView form.
Moving the horizontal scrollbar will move the FXZ and FYZ planes for test purposes.

Best regards

Klaus
Attachments
Example project.zip
(153.99 KiB) Downloaded 758 times

Yeray
Site Admin
Site Admin
Posts: 9514
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: How to make a TSurfaceSeries show transparent ?

Post by Yeray » Tue Jun 17, 2014 3:47 pm

Hello,

I could reproduce the problem even with a new simple project with just a TChart3D and a Surface. If I set a Transparency > 0 for the Surface, it isn't drawn at all.
I've added it to the public tracker:
http://bugs.teechart.net/show_bug.cgi?id=803
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

niotronic
Newbie
Newbie
Posts: 2
Joined: Thu Jun 25, 2015 12:00 am

Re: How to make a TSurfaceSeries show transparent ?

Post by niotronic » Fri Jun 26, 2015 2:50 pm

Dear Yeray,

would you like to tell me if you have already started working on this problem (BUG 803), since it's more than a year ago it was confirmed ?

Best regards,

Klaus

Yeray
Site Admin
Site Admin
Posts: 9514
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: How to make a TSurfaceSeries show transparent ?

Post by Yeray » Tue Jun 30, 2015 3:01 pm

Hi Klaus,

We've just fixed it so the next maintenance release should included this fix.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply