Upgrades to 1.50 and transparency on imagedrawable is gone


#1

Hi all,

I upgraded today from juce 1.46 to 1.50.
I’m using the amalgamated header and cpp file in my project.

I was creating icons from embedded PNG data with the binarybuilder like this:

Drawable *dIcon =  = Drawable::createFromImageData (embeddedresources::macro_node_png, embeddedresources::macro_node_pngSize);
...
dIcon->drawAt (g, x + 4, cy);

the icons are PNG files with transparency, transparent background.
since the switch they draw with black background, the transparency is gone.

i also looked at the documentation (online),
and there seems to be a difference between this and 1.50:

this is in the online docs:

void 	drawAt (Graphics &g, const float x, const float y, const float opacity) const 

in my 1.50 download there’s no ‘const float opacity’.
(from juce_amalgamated.h:)

  void drawAt (Graphics& g,
                 const float x,
                 const float y) const;

however, according to the docs that opacity should’nt even matter for me as it will just make everything opaque or transparent.

does anyone know why the embedded PNG’s alpha channels is’nt drawn anymore ?
how can i fix it ?

Thanks :slight_smile:
Radiance


#2

Sounds like you’re using the release version of 1.50, as the docs are later than that. I’d recommend using the latest tip at the moment, actually - the png problem might be a bug that has been fixed since then, as I’ve done a lot of graphics changes and testing since the release.


#3

i replaced all my icon fetch code with using the imagecache and now it works,
i’m drawing Images not Drawable 's anymore…

Thank,
Radiance


#4