XylemFlow 8 Posted February 2 I need to be able to draw several objects to a form or TImage TCanvas, including lines, circles, polygons, text, etc and have them drawn as a group with a single opacity. If I draw them separately then it won't look correct where they overlap. I currently do this by drawing the objects to an offscreen TBitmap canvas with full opacity and then drawing the TBitmap to my form or TImage TCanvas with the opacity I want. However, this is slower and uses more memory. I'd also like to use Skia in future, but I understand that drawing to offscreen bitmaps is slower since it doesn't use the GPU. Is there a method to group objects in this way in default FMX or Skia without using an offscreen bitmap? Share this post Link to post
Keesver 23 Posted February 8 You can add all objects to the same TLayout and then control the opacity from this TLayout. Share this post Link to post
Rollo62 539 Posted February 9 All objects under same layout and managing layers and groups with TLayout: Yes, definitively. Not sure what kind of "opacity" you need, but you could also put finally a TRectangle as cover over all, with Align := Contents, and set HitTest := False, Stroke.Kind := None, File.Color := White (or Black depending on your design), and set Opacity as you desire. This will "grey out" the underlying objects, while they are still active. Share this post Link to post
XylemFlow 8 Posted February 12 Unfortunately I need to draw everything directly on a single TCanvas. I cannot do it by layering controls on top of each other. One reason is because I need to export the resulting image. By sharing the same opacity I mean that they should be semi transparent and so show previously drawn objects underneath Share this post Link to post