C'est possible si tu créer ta propre PictureBox.
Et dans ta forme tu dois aussi rajouter :
this.ResizeRedraw = true;
Bitmap bmp = new Bitmap( "image.bmp" );
bmp.MakeTransparent( bmp.GetPixel( 0, 0 ) );
MyPictureBox pb1 = new MyPictureBox( );
pb1.Image = bmp;
public class MyPictureBox : UserControl
{
private const int WS_EX_TRANSPARENT = 0x00000020;
private Image image = null;
public Image Image { get { return image; } set { image = value; } }
public MyPictureBox( ) : base( )
{
}
protected override CreateParams CreateParams
{
get
{
CreateParams cp = base.CreateParams;
cp.ExStyle |= WS_EX_TRANSPARENT;
return cp;
}
}
protected override void OnPaintBackground( PaintEventArgs e )
{
// vide.
}
protected override void OnPaint( PaintEventArgs e )
{
//base.OnPaint( e );
if ( image == null )
return;
e.Graphics.DrawImage( image, this.ClientRectangle );
}
}