Page 1 of 1

Transparent TBItmap becomes non-transparent in GDI+ mode

Posted: Fri Feb 28, 2014 9:24 pm
by 16565755
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?

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

Posted: Mon Mar 03, 2014 11:31 am
by yeray
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.

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

Posted: Mon Mar 03, 2014 6:53 pm
by 16565755
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.

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

Posted: Tue Mar 04, 2014 11:18 am
by yeray
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.

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

Posted: Tue Mar 04, 2014 2:17 pm
by 16565755
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.

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

Posted: Wed Mar 05, 2014 11:10 am
by yeray
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.