C # transparent background processing of Flash

Source: Internet
Author: User

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!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.