Now it is found that VB is really convenient. C # is also good, but the flash processing is not as convenient as using some controls! In VB, The flash is easy to handle transparently. You only need to modify the WMode attribute of the flash control shockwaveFlash: wmode = Transparent, but in C #, The flash control does not respond to this setting! Internet access, Baidu, Google, sousosearch! No solution is available, but a control f_in_box_lib.dll is found! Although it supports transparent flash background, there is only one control in hand and there is no relevant description. It is equivalent to giving it a fish instead of a fish! No way, directly visit f_in_box official website http://www.f-in-box.com/dotnet/ (f_in_box. net version), look at the help! Found the relevant code:
In two steps:
1. WMode = Transparent (set in attribute list)
2. Respond to the f_in_box_lib OnPaintStage event and add the code
If (f_in_box _ lib. PaintStage. PrePaint = stage)
{
F_in_box _ lib. f_in_box _ control = (f_in_box _ lib. f_in_box _ control) sender;
Using (Bitmap B = new Bitmap (Width, Height ))
{
Using (Graphics g = Graphics. FromImage (B ))
{
PaintEventArgs pea = new PaintEventArgs (g, new Rectangle (f_in_box _ control. Location, f_in_box _ control. Size ));
This. OnPaintBackground (pea );
This. OnPaint (pea );
G. DrawImage (
PictureBox1.Image,
New Rectangle (pictureBox1.Location, pictureBox1.Size ),
New Rectangle (new Point (0, 0), pictureBox1.Image. Size ),
GraphicsUnit. Pixel );
Canvas. DrawImage (
B,
New Rectangle (new Point (0, 0), f_in_box _ control. Size ),
New Rectangle (f_in_box _ control. Location, f_in_box _ control. Size ),
GraphicsUnit. Pixel );
}
}
}
In this way, the background of flash is transparent!
The official f_in_box website has implemented Demo download with the source code! If the above steps cannot help you, go to the official website to download the Demo! The only drawback is that the download speed is so slow! Sometimes it cannot reach 1kb/s!