Hello,
i was looking, if I can find help on TPad and Transparency.
The setting:
I have a star (a christmas star for example) as a png file with a transparent background.
Now I want to draw this Image on Top over a background Image, in such a way that one sees only the star and not the backround of the embedding pad. Unfortunately I havent found a solution yet.
In the code I do the following (as in the tutorials described):
// Step into BIGCANVAS
BIGCANVAS->cd();
// Create Pad:
TPad *p1 = new TPad("i1", "i1", xc-wx/2, yc-wy/2 , xc+wx/2, yc+wy/2);
// Open Right Picture:
TImage *i1 = TImage::Open(Form("xxxx-%d.png",NumberOfPicture));
i1->SetConstRatio(kFALSE);
// Draw Pad, then Picture into Pad.
p1->SetFillStyle(0); // 0 : hollow // strangely this will NOT make the pad transparent !
p1->SetFillColor(0);
p1->Draw();
p1->cd();
i1->Draw();
// Step back into BIGCANVAS
BIGCANVAS->cd();
BIGCANVAS->Update();
The pad is still white solid filled.
Is there an easy solution?
Best Regards,
Frank