//播放时  图片周围有锯齿白边出现    反锯齿处理暂无解决办法、 如有大神 请给我留言

新Form    AllowDrop True

引用using System.IO;

拖1个Button

public Form1()
        {
            InitializeComponent();
        }

  string fileName;
        String extendedName;
        String fileName1;

private void button1_Click(object sender, EventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();                //new一个方法
            ofd.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); //定义打开的默认文件夹位置
            ofd.ShowDialog();          //显示打开文件的窗口
            fileName = ofd.FileName;                //获得选择的文件路径
            extendedName = Path.GetExtension(fileName);       //获得文件扩展名
            fileName1 = Path.GetFileName(fileName);

PlayFlash f = new PlayFlash(fileName);
            f.Show();

}

//拖入

private void Form1_DragEnter(object sender, DragEventArgs e)
        {
            if (e.Data.GetDataPresent(DataFormats.FileDrop))
            {
                e.Effect = DragDropEffects.Copy;
            }
        }

//拖入操作释放

private void Form1_DragDrop(object sender, DragEventArgs e)
        {
            if (e.Data.GetDataPresent(DataFormats.FileDrop))
            {
                string[] MyFiles = (string[])(e.Data.GetData(DataFormats.FileDrop));
                if (MyFiles.Length > 0)
                {
                    PlayFlash f = new PlayFlash(MyFiles[0]);//播放窗体传值
                    f.Show();//播放窗体显示
                }
            }
        }

新建Form

拉一个webBrowser

拖1个timer

设计Form背景为透明等属性

/// <summary>
        /// 存放Flash路径
        /// </summary>
        string playFile = "";

public string Isplay;

/// <summary>
        /// 获取Flash路径并渲染窗体
        /// </summary>
        /// <param name="file"></param>
        public Form1(string file)
        {
            playFile = file;
            InitializeComponent();
        }

private void Form1_Load(object sender, EventArgs e)
        {
            //新的文档
            webBrowser1.Navigate("about:blank");

//判断文档是否在加载
            while (webBrowser1.IsBusy)
            {
                Application.DoEvents();
            }
          
            webBrowser1.Document.Write("<HTML>");
            webBrowser1.Document.Write("<HEAD>");
            webBrowser1.Document.Write("<TITLE>");
            webBrowser1.Document.Write("</TITLE>");
            webBrowser1.Document.Write("<script type='text/javascript' language='javascript'>");
            webBrowser1.Document.Write("function a() {");
            webBrowser1.Document.Write("var ab= document.swf.IsPlaying();");
            webBrowser1.Document.Write("var d = document.getElementById('xxx');");
            webBrowser1.Document.Write("d.value = ab;");
            webBrowser1.Document.Write(" }");
            webBrowser1.Document.Write("</script>");
            webBrowser1.Document.Write("</HEAD>");
            webBrowser1.Document.Write("<BODY>");
            //网页效果输出Flahs
            webBrowser1.Document.Write(string.Format("<object  classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\"100%\" height=\"100%\" id=\"swf\"> <param name=\"wmode\" value=\"transparent\"><param name=\"movie\" value=\"{0}\"> <param name=\"quality\" value=\"high\"><param name=\"LOOP\" value=\"false\" /></object>", playFile));
            webBrowser1.Document.Write("<input id=\"xxx\" type=\"hidden\" runat=\"server\" /></BODY>");
            webBrowser1.Document.Write("</HTML>");

timer1.Interval = 50;
            timer1.Enabled = true;

}

int sum = 0;

private void timer1_Tick(object sender, EventArgs e)
        {
            webBrowser1.Document.InvokeScript("a");

Isplay = webBrowser1.Document.All["xxx"].GetAttribute("value");
            if (Isplay == "false")
            {
                    timer1.Enabled = false;
                    this.Close();
            }
            sum = sum + 1;
            if (sum > 100)
            {
                timer1.Enabled = false;
                this.Close();
            }
        }

C# winfrom中Flash播放使用axShockwaveFlash控件设置透明XP出现白色背景解决办法,仿QQ魔法表情效果的更多相关文章

  1. qtp录制时间控件不允许用户手动输入的解决办法

    qtp录制时间控件不允许用户手动输入的解决办法 [前面的话] 一边学习qtp,一边用自己的项目试着写代码,而遇到一个问题就会让自己卡壳很久,这次也是这样的,在写好了登录代码以后,自己就试着写第一个预订 ...

  2. ActiveX控件注册不起作用的解决办法

    公司写了一个ActiveX打印插件.其中一个同事的电脑死活不能用.于是我就上网找办法 这位兄弟写的比较清晰. ActiveX交互时浏览器的设置以及ActiveX控件注册的检测 http://blog. ...

  3. qt 给父窗体设置样式不影响子控件样式以及子控件设置透明

    1.父窗体样式不生效? this->setAttribute(Qt::WA_StyledBackground); 2.父窗样式体影响子控件? this->setStyleSheet(&qu ...

  4. 在创建窗口句柄之前,不能在控件上调用 Invoke 或 BeginInvoke 解决办法

    增加IsHandleCreated 判断 if (this.IsHandleCreated) { this.Invoke(new EventHandler(delegate { ...... })); ...

  5. 2.QT浏览器控件设置“透明颜色”

    使用样式表或者设置背景颜色,使用 background-color:transparent 但,使用透明的颜色是不可行的: QColor(255,0,0,0)

  6. 弹出框页面中使用jquery.validate验证控件

    弹出框页面中使用jquery.validate验证控件有几个问题需要解决: 1,弹出框的提交事件完成后如何关闭弹出框页面? 2,提交不成功如何返回当前页? 3,如果知道验证事件成功? 之前笔者都是JS ...

  7. 示例:WPF中Slider控件封装的缓冲播放进度条控件

    原文:示例:WPF中Slider控件封装的缓冲播放进度条控件 一.目的:模仿播放器播放进度条,支持缓冲任务功能 二.进度: 实现类似播放器中带缓存的播放样式(播放区域.缓冲区域.全部区域等样式) 实现 ...

  8. 交互式的Flash图表和仪表控件AnyChart

    AnyChart使你可以创建出绚丽的交互式的Flash图表和仪表控件.是一款灵活的基于Adobe Flash和跨浏览器和跨平台的图表解决方案,被很多知名大公司所使用,可以用于仪表盘的创建.报表.数据分 ...

  9. WPF中不规则窗体与WebBrowser控件的兼容问题解决办法

    原文:WPF中不规则窗体与WebBrowser控件的兼容问题解决办法 引言 这几天受委托开发一个网络电视项目,要求初步先使用内嵌网页形式实现视频播放和选单,以后再考虑将网页中的所有功能整合进桌面程序. ...

随机推荐

  1. VMware网络模式介绍(下篇)

    VMware网络模式介绍 VMWare提供了三种工作模式,它们是bridged(桥接模式).NAT(网络地址转换模式)和host-only(主机模式). Bridged 模式: 在桥接模式下,VMwa ...

  2. 关于URL编码的问题

    在进行WEB开发时,字符集编码常常困扰着我们.我们需要区分两种情况,一是URL编码,二是HTTP Body编码.这两种编码所处理的机制不同. URL编码和解码 客户端负责对URL编码,服务端负责解码. ...

  3. 续上文----线性表之单链表(C实现)

    本文绪上文线性表之顺序表(C实现) 本文将继续使用单链表实现线性表的另外一种存储结构.这种使用链表实现的存储结构在内存中是不连续的. C实现代码如下: #include<stdio.h> ...

  4. MarkDown基础使用教程-by sixleaves

    以下是个人浏览文档,结合自己平时使用所总结, 和引用国外关于如何使用markdown的教程.如有不足,还请海涵,期待于您的交流.我觉得使用markdown书写挺好的! 工具下载,可以去下载gitboo ...

  5. 移动web开发前准备知识了解(html5、jquery)笔记

    1.经常使用 插件工具  chrome插件:   Mobile & Tablet Emulator(用于常见移动端适配):(重点) Mobile Emulator is an useful o ...

  6. 2014 ACM省赛总结

    今年ACM省赛已经过去一个星期左右了,2年的ACM训练是该做个总结了,因为前几日去參加蓝桥杯总决赛,所以没来的及写总结,如今在这小小总结一下吧-- 依晰记得去年省赛时候的样子,如今感觉那时像是个无知的 ...

  7. C#获取URL参数值(NameValueCollection)

    在写程序的时候,我们经常需要对页面进行传参数,比如page?id=1234,那么在page这个页面中就直接可以使用string id = Request.QueryString["id&qu ...

  8. UVA 1001 Say Cheese

    题意: 一只母老鼠想要找到她的玩具,而玩具就丢在一个广阔的3维空间上某个点,而母老鼠在另一个点,她可以直接走到达玩具的位置,但是耗时是所走过的欧几里得距离*10s.还有一种方法,就是靠钻洞,洞是球形的 ...

  9. AjaxHelper学习,ajax,microsoft,mvc,asp.net

    index.cshtml @using (Ajax.BeginForm("ContentAjax", new AjaxOptions { UpdateTargetId = &quo ...

  10. Http的Post和Get

    原文:http://www.cnblogs.com/hyddd/archive/2009/03/31/1426026.html Http定义了与服务器交互的不同方法,最基本的方法有4种,分别是GET, ...