Page 1 of 1

How to make a TSurfaceSeries show transparent ?

Posted: Sat Jun 14, 2014 5:21 pm
by 16566563
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

Re: How to make a TSurfaceSeries show transparent ?

Posted: Mon Jun 16, 2014 8:41 am
by yeray
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;

Re: How to make a TSurfaceSeries show transparent ?

Posted: Mon Jun 16, 2014 1:31 pm
by 16566563
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

Re: How to make a TSurfaceSeries show transparent ?

Posted: Tue Jun 17, 2014 10:14 am
by yeray
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.

Re: How to make a TSurfaceSeries show transparent ?

Posted: Tue Jun 17, 2014 2:55 pm
by 16566563
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

Re: How to make a TSurfaceSeries show transparent ?

Posted: Tue Jun 17, 2014 3:47 pm
by yeray
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

Re: How to make a TSurfaceSeries show transparent ?

Posted: Fri Jun 26, 2015 2:50 pm
by 16573939
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

Re: How to make a TSurfaceSeries show transparent ?

Posted: Tue Jun 30, 2015 3:01 pm
by yeray
Hi Klaus,

We've just fixed it so the next maintenance release should included this fix.