1. Konstantin Goldobin
  2. PowerBuilder
  3. Wednesday, 29 May 2019 07:18 AM UTC

Hello,

I was wondering if anyone knows how to use the transparentcolor property of a datawindow picture control. I think it was introduced in 11.5 but was not documented in 12.5 or even 2017. When I set it to a regular calculated RGB value in the painter and save, PB changes my value to 0. When I type it in the Edit source mode and save, PB changes it to a cryptic value that starts with $$HEX. In either case the colour I want to be transparent in my bitmap is not transparent. (I tried both options in 12.5 only.) The DWSyntax tool shows it as an integer value:

[DW Control Name].Modify("[BitMapname].TransparentColor='[an integer]'")

But RGB values are usually long. So, what kind of integer values am I supposed to use?

Best regards,
Konstantin

Accepted Answer
Konstantin Goldobin Accepted Answer Pending Moderation
  1. Thursday, 14 December 2023 10:24 AM UTC
  2. PowerBuilder
  3. # Permalink

It works in PB 2029 R3. The property is still not documented but it accepts long RGB values and makes the colour in the image transparent.

Comment
There are no comments made yet.
Berka Frenfert Accepted Answer Pending Moderation
  1. Wednesday, 29 May 2019 10:33 AM UTC
  2. PowerBuilder
  3. # 1

The picture itself should be with transparent background.

All transparent images are not actually transparent for PowerBuilder 12.5. That means some transparent images will show dark background when use in PowerBuilder. Just make sure you use the one that is compatible with PowerBuilder.

I used .png

I could not find the reason why actual transparent images are not transparent when used in PB. 

You dont have to set transparency % of the image control in PB. Just find the right transparent png image and it will work.

 

Attached a transparent gif

Attachments (1)
Comment
  1. Konstantin Goldobin
  2. Friday, 31 May 2019 08:07 AM UTC
Thanks! But I was asking about the TransparentColor property, not about Transparency or images with transparent background.
  1. Helpful
  1. Berka Frenfert
  2. Wednesday, 19 June 2019 06:44 AM UTC
Transparency cannot be more than 100 , i dont know how you use RGB() for transparency.



You are right, the property name is transparency in PB12.5 not the TransparentColor (TransparentColor makes no sense).



dw_1.Object.the_bmp.transparency = 88



Thank you for reminding real objective
  1. Helpful
  1. Berka Frenfert
  2. Wednesday, 19 June 2019 07:01 AM UTC


I think you should edit your DW source and replace TransparentColor="88" with transparency="88" and it will work.
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.