Je voulais savoir s'il etait possible du "traitement d'image" dans un panel.

Voici ce que j'ai a date:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
 
void w_PicBG()
{
 
	int W = panPacMan->Width;
	int H = panPacMan->Height;
 
	//----
	Bitmap^ im2 = gcnew Bitmap(W,H,Imaging::PixelFormat::Format32bppArgb);
	Bitmap^ im1 = gcnew Bitmap(W,H,panPacMan->BackgroundImage->PixelFormat);
	//----
 
	for(int li=0; li < H; li++)
	{
		for(int col=0; col < W; col++)
		{
			Color c = im1->GetPixel(col,li);
			if(c.A != 255)
			{
				im2->SetPixel(col,li,c.FromArgb(255,0,0,0));
			}
		}
	}
}
mais cela me donne l'exception:

Object reference not set to an instance of an object.
sur

Code : Sélectionner tout - Visualiser dans une fenêtre à part
Bitmap^ im1 = gcnew Bitmap(W,H,panPacMan->BackgroundImage->PixelFormat);

Le but est de rendre transparent qu'une partie de mon panel panPacMan.