This project is read-only.

G2DPanel() set transparent to 0.0F

Jul 30, 2012 at 11:56 PM


This is something change in 4.1 compare to 3.5?

I have a G2DPanel() as


frame = new G2DPanel();

// Specify the frame bound

frame.Bounds =

new Rectangle(frameTopLeftX, 0, (int)(0.25 * screenWidth), (int  

)(0.97 * screenHeight));

frame.Border =


frame.Transparency = 0;

I expect the frame should be transparency in 4.1 version but not. It used to work in version 3.5

I try a work around like by setting this

frame.BackgroundColor = new Color(0, 0, 0, 0);

Then it is transparent.

Just want to share in case someone face the same situation.

Jul 31, 2012 at 3:22 AM

Thanks for the report. I just checked it and indeed, you're right. For some reason, setting it to 0 is not working. Basically, the XNA APIs changed a lot from 3.1 to 4.0, and I probably didn't make the right change for 2D drawing. I will look into the problem.