Transparent TBItmap becomes non-transparent in GDI+ mode

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
vgromov
Newbie
Newbie
Posts: 8
Joined: Mon Apr 29, 2013 12:00 am
Location: Moscow, Russian Federation
Contact:

Transparent TBItmap becomes non-transparent in GDI+ mode

Post by vgromov » Fri Feb 28, 2014 9:24 pm

C++ Builder XE4.
Tee Build.201.10.140220
OS Windows 7, 32 bit
I use TBitmap object with Transparent=true; TransparentColor=clBlack; for custom drawing in Chart's BeforeDrawSeries.
TTeeGDIPlus object is attached to the chart. If the former has Active = true, bitmap is drawn with black fields. Setting GDI+ Active=false fixes this behavior, bitmap is rendered transparently.
Is there any special trick required to paint this image transparently on GDI+ canvas as well?

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

Re: Transparent TBItmap becomes non-transparent in GDI+ mode

Post by Yeray » Mon Mar 03, 2014 11:31 am

Hello,

This sounds similar to this:
http://www.teechart.net/support/viewtop ... =3&t=14630

I also see you've added a ticket to the tracker: http://bugs.teechart.net/show_bug.cgi?id=613
As you'll see we couldn't 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

vgromov
Newbie
Newbie
Posts: 8
Joined: Mon Apr 29, 2013 12:00 am
Location: Moscow, Russian Federation
Contact:

Re: Transparent TBItmap becomes non-transparent in GDI+ mode

Post by vgromov » Mon Mar 03, 2014 6:53 pm

I've attached test project for case study.
It (tries to) generate CIE 1931 xyz chart with colour 'horse foot' behind it.
The 'horse foot' is dynamically generated dib, which uses black as transparent key colour. It's being drawn OK in GDI mode,
but becomes opaque in GDI+ mode. This code is from the earlier stage of the project, later, I tried all kind of Alpha modes, like defined and premultiplied, but the best result was opaque neverthless, if alpha channel is used for
thransparent areas fill, like in 0xff000000 colour, the transparent area remained opaque, but was drawn in light gray colour, no black.
Attachments
ColorTest.zip
TestProject
(13.19 KiB) Downloaded 684 times

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

Re: Transparent TBItmap becomes non-transparent in GDI+ mode

Post by Yeray » Tue Mar 04, 2014 11:18 am

Hello,

Thanks for the project but it's more than 500 lines of C++ code, making it difficult for us to debug it.
We'd need a simple example project we can run as-is to reproduce the problem here, not the big project.
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

vgromov
Newbie
Newbie
Posts: 8
Joined: Mon Apr 29, 2013 12:00 am
Location: Moscow, Russian Federation
Contact:

Re: Transparent TBItmap becomes non-transparent in GDI+ mode

Post by vgromov » Tue Mar 04, 2014 2:17 pm

Sorry for bloated example, guys :) Ripped it from the working project.
I will try to make simple project, but it'll take time. Let me explain.
For some reason, when I install both VCL and FMX Tee packages, my C++ Builder refuses to "see" FMX TChart in palette and form designer (I mentioned this in either this forum or bug tracker, do not remember clearly).
So, for me switching between VCL and FMX frameworks, takes quite a lot of PITA of carefully removing VCL packages from IDE, and installing FMX ones, in certain order :) Kind of dark ritual.
So, as soon my main development framework is FMX, and the transparency stuff I ran into, was in VCL, I need to postpone further efforts, until the end of the working week.

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

Re: Transparent TBItmap becomes non-transparent in GDI+ mode

Post by Yeray » Wed Mar 05, 2014 11:10 am

Hi
vgromov wrote:Sorry for bloated example, guys :) Ripped it from the working project.
I will try to make simple project, but it'll take time. Let me explain.
For some reason, when I install both VCL and FMX Tee packages, my C++ Builder refuses to "see" FMX TChart in palette and form designer (I mentioned this in either this forum or bug tracker, do not remember clearly).
So, for me switching between VCL and FMX frameworks, takes quite a lot of PITA of carefully removing VCL packages from IDE, and installing FMX ones, in certain order :) Kind of dark ritual.
So, as soon my main development framework is FMX, and the transparency stuff I ran into, was in VCL, I need to postpone further efforts, until the end of the working week.
I'm sorry to hear you are suffering such inconvenient. I see you reported it here but we weren't able to reproduce the problem here. If you have any extra clue that may help us to investigate where the problem may come from, don't hesitate to post it in that thead.

Regarding the problem in this thread, if you are in FMX, I'm not asking you to move to VCL to prepare the simple example. You can do it in FMX or VCL, where you prefer, but simple.
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