Recent

Author Topic: How to make semi-transparent BGRABitmap?  (Read 952 times)

hedgehog

  • New Member
  • *
  • Posts: 48
How to make semi-transparent BGRABitmap?
« on: May 10, 2024, 03:55:53 pm »
Hi.

I want the TBGRASVG to be drawn semi-transparent in some cases.
Is there an easy way?

lainz

  • Hero Member
  • *****
  • Posts: 4704
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: How to make semi-transparent BGRABitmap?
« Reply #1 on: May 10, 2024, 06:01:29 pm »
Create a temporary bitmap, draw the SVG into it. Then draw the temporary bitmap in the target bitmap with transparency-

You can use PutImage

circular

  • Hero Member
  • *****
  • Posts: 4404
    • Personal webpage
Re: How to make semi-transparent BGRABitmap?
« Reply #2 on: May 11, 2024, 10:29:14 pm »
Otherwise you can set the globalAlpha property (from 0 to 1) of the Canvas2d before you draw on it. The result might be slightly different, but each element of the SVG will be drawn according to it.
Conscience is the debugger of the mind

 

TinyPortal © 2005-2018