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

新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. Sysstat性能监控工具包中20个实用命令

    Sysstat性能监控工具包中20个实用命令 学习mpstat, pidstat, iostat和sar等工具,这些工具可以帮组我们找出系统中的问题.这些工具都包含了不同的选项,这意味着你可以根据不同 ...

  2. C语言的本质(23)——C标准库之输入与输出(上)

    1..文件的基本概念 所谓"文件"是指一组相关数据的有序集合.这个数据集有一个名称,叫做文件名.实际上在前面的各章中我们已经多次使用了文件,例如源程序文件.目标文件.可执行文件.库 ...

  3. 你真的用上keepalive了吗

    转自http://qa.blog.163.com/blog/static/19014700220134771052763/ Keep-Alive即俗称的长连接,使客户端到服务端建立的连接持续有效,当对 ...

  4. 【POJ 3614 Sunscreen】贪心 优先级队列

    题目链接:http://poj.org/problem?id=3614 题意:C头牛去晒太阳,每头牛有自己所限定的spf安全范围[min, max]:有L瓶防晒液,每瓶有自己的spf值和容量(能供几头 ...

  5. raft 一致性算法

    介绍: 过去, Paxos一直是分布式协议的标准,但是Paxos难于理解,更难以实现,Google的分布式锁系统Chubby作为Paxos实现曾经遭遇到很多坑. 来自Stanford的新的分布式协议研 ...

  6. linux学习方法之六

    相信不少想学习linux的新手们正愁不知道看什么linux学习教程好,下面小编给大家收集和整理了几点比较重要的教程,供大家学习,如需想学习更多的话,可到wdlinux学堂寻找更多教程. 1.linux ...

  7. vim改变多窗口的大小

    摘自:http://blog.163.com/lgh_2002/blog/static/44017526201031671927647/ vim改变多窗口的大小 VIM改变窗口大小 *window-r ...

  8. Hadoop CLI MiniCluster

    CLI MiniCluster Use the climonicluster, users can simply start and stop a single-node hadoop cluster ...

  9. 黑马程序员 Java基础<九>---> 多线程

    ASP.Net+Android+IOS开发..Net培训.期待与您交流! 多线程 一.概述: 1.线程是什么 说到线程,我们就得先说说进程.所谓进程,就是一个正在执行(进行)中的程序,每一个进程执行都 ...

  10. 实现在Android 多点手势识别

    google 提供的API中,有个类,大家都很熟悉,GestureDetector.使用它,我们可以识别用户通常会用的手势.但是,这个类不支持多点触摸(可能 google认为没有人会在几个手指都在屏幕 ...