使用 Flash 和 C# WinForm 配合打造界面漂亮的应用程序

【J-Flash基本使用总结】 注明:读取flash数据后,用读出来的数据在烧录在其他单片机上完成批量烧录,就可以减去烧录boot 后再用串口升级boot,app 慢的的烦恼,工厂人力节省下来了。,选择CPU ==> Device , 选择芯片型号,如STM32F103VC,然后点击 OK。设置了读保护后,要想解除,只能先连接芯片,使芯片自动擦除flash,之后再重新上电连接,就可以连接了,连接后解除读保护即可。设置了读保护后,再用j-link等工具去连接芯片或执行命令都会使芯片自动擦除flash,以达到保护代码的目的。 阅读详情
要在 WinForm 中使用 Flash,通常需要用到 Shockwave Flash Object 这个 COM 组件。 ( http://www.codeproject.com/csharp/fscommand.asp) ( http://www.codeproject.com/useritems/FlashDBInteract.asp)

具体步骤如下: 首先添加对 COM 组件 Shockwave Flash Object 的引用,将该组件拖到窗体上之后,可以设置如下关键属性:

Movie: flash 的存放地址 EmbedMovie: 是否嵌入到程序的资源中。

接下来你可以设置其他一些属性,使得 Flash 的窗口最大化,隐藏掉其宿主程序的 C# WinForm 窗体。

在 Flash 的 ActionScript 中,可以通过 FSCommand 函数与 hosting app 通信,该函数有两个参数,分别是:

command: 命令名称 parameters: 参数

例子:

on(press){      fscommand( " Circule " ,  " Green " ); }

在 C# 中,处理 flash 对象的 FSCommand 事件即可。 如果该事件处理函数的 EventArgs 为 e, 则有如下对应关系:

e.command -> flash 中调用 FSCommand 时的 command 参数; e.args -> flash 中调用 FSCommand 时的 arguments 参数。

在 C# 中往 Flash 传递数值用 SetVariable 方法:

axShockwaveFlash1.SetVariable( " variablename " ,  " valueasstring " );

对应的,有一个 GetVariable 方法可以获得 flash 中的变量值。

FSCommand 的参数只能传递一个,所以其功能存在一定的局限性。在你需要传递多个参数的时候,则需要在调用方用字符串拼接各个参数值,然后在被调用方重新解开。这种办法使得复杂的传值显得很丑陋。

不过,除了 FSCommand 外,我们还有另一种办法和 flash 通信,就是使用 Flash Player 8 External API. (http://www.codeproject.com/cs/media/flashexternalapi.asp)

使用 External API,可以实现 ActionScript 和 C# 的双向调用。其好处就在于每次调用时的参数和返回值都通过一个 xml 文档来传递,这样就比 FSCommand 功能完善了很多。当然在 C# 中,我们也需要声明一下外部函数实现的对应关系。

代码片段: Flash ActionScript 中声明提供给 hosting application 调用的回调函数:

import flash.external.ExternalInterface; ExternalInterface.addCallback( " loadAndPlayVideo " ,  null , loadAndPlayVideo);

C# 中调用 Flash 的情形:

     flashPlayer.CallFunction( " <invoke "   +              "  name=/ " loadAndPlayVideo/ "  returntype=/ " xml/ " >            < arguments >< string > "  + fileDialog.FileName +             " </string></arguments></invoke> " ); 

在 ActionScript 中调用 C# 函数:

ExternalInterface.call( " ResizePlayer " ,        videoPlayer.metadata.width, videoPlayer.metadata.height);

在 C# 中声明被 Flash 调用的函数:

flashPlayer.FlashCall  +=      new  _IShockwaveFlashEvents_FlashCallEventHandler(flashPlayer_FlashCall);

在此,我们可以看到 C# 和 Flash 进行通信还是相当方便的。

除此之外,我顺便搜索到其他一些和 flash 有关的不错的文章:

Flash and .NET with FlashRemoting http://www.codeproject.com/aspnet/FlashRemoting.asp

Multiple File Upload With Progress Bar Using Flash and ASP.NET http://www.codeproject.com/aspnet/FlashUpload.asp

Flash GUI for your exe using minimalistic approach (C++) http://www.codeproject.com/useritems/FlashGui.asp C#中的回调函数 axShockwaveFlash.FlashCall +=     new _IShockwaveFlashEvents_FlashCallEventHandler(SetNum); public void SetNum(object sender,_IShockwaveFlashEvents_FlashCallEvent e)   { //得到参数列表    ArrayList paraList = GetParaList(e.request);   } public ArrayList GetParaList(string ParaListXml)   {    XmlDocument doc = new XmlDocument();    doc.LoadXml(ParaListXml);        XmlNodeList pareNodeList = doc.GetElementsByTagName("string");        ArrayList paraList = new ArrayList();    foreach(XmlNode node in pareNodeList)    {     paraList.Add(node.InnerText);    }        return paraList;   }

 

转自:http://www.cnblogs.com/sunrack/articles/561203.html

C# 代码控制Jlink自动给芯片烧录程序 程序控制jlink进行自动化烧程,并能够反馈烧录结果。本质上是jlink提供了用指令烧录的支持,本代码是用C#调用cmd来运行拼接好的jlink指令来烧程指定文件 阅读详情

相关推荐

自己开发jlink烧录软件,烧录上位机, C#调用JLinkARM.dll实现软件烧录

最近需要写一个烧录软件,让工厂可以实现一键烧录。

weixin_47124634的博客 7838

使用 Flash 和 C# WinForm 配合打造界面漂亮的应用程序(摘要)

(木野狐 2006-10-29) 由于之前一阵公司一个项目提出的需求,自己也想进行这方面的尝试,我对如何使用 Flash 来做 WinForm 程序的界面产生了兴趣,于是学习了一些资料,摘要于此。下图是我做的一个 demo 程序的界面: 要在 WinForm 中使用 Flash,通常需要用到 Shockwave Flash Object 这个 COM 组件。(http://www.codepr...

weixin_34226182的博客 376

基于STM32与RFID的智能仓库管理系统毕业设计全解析

嵌入式系统是连接物理世界与数字世界的核心技术,其核心原理在于通过微控制器(MCU)执行特定程序,实现对传感器、执行器等外围硬件的精准控制与数据处理。这项技术的核心价值在于能够构建稳定、高效、低成本的专用计算设备,广泛应用于工业控制、消费电子和物联网等领域。在物联网应用场景中,射频识别(RFID)技术作为一种非接触式的自动识别技术,通过无线电波读取或写入标签信息,是实现物品智能化管理的关键。结合嵌入式系统,可以构建诸如智能仓储、物流追踪、门禁管理等解决方案。本文聚焦于一个具体的工程实践案例——基于STM32微

weixin_30279315的博客 420

c# 与flash

1.加载flash组件 一、基本原理及过程 Flash通过ExternalInterface类与容器应用程序进行通信。为此,ExternalInterface类提供两个静态属性和两个静态方法。 ExternalInterface.call(“函数名”,[参数…])方法执行容器应用程序的代码,该方法至少需要一个字符串参数来指定要调用的函数名,其它任何参数将作为参数被传递给被调用函数。在除浏览

lllljz的专栏 1814

C#与Flash交互

C#与Flash交互

Flash(AS3)和C#之间的相互函数调用(例子)

Flash(AS3)和C#之间的相互函数调用。例子(包括Flash端和C#端)

使用Flash和C# WinForm配合打造界面漂亮的应用程序

由于之前一阵公司一个项目提出的需求,自己也想进行这方面的尝试,我对如何使用 Flash 来做 WinForm 程序的界面产生了兴趣,于是学习了一些资料,摘要于此。 要在 WinForm 中使用 Flash,通常需要用到 Shockwave Flash Object 这个 COM 组件。(http://www.codeproject.com/csharp/fscommand.asp)(htt

王以山的专栏 2335

C#版Flash播放器源代码,简单实用

内容索引:C#源码,多媒体技术,播放器,Flash  C#Flash播放器,其核心是基于两个动态链接库:AxInterop.ShockwaveFlashObjects.dll以及Interop.ShockwaveFlashObjects.dll,大家把它当作一个练习吧,通过这个小程序学习一下这两个动态库的用法,如何通过这两个控件写出一个支持动画控制播放的Flash播放器,同时它还支持一帧一帧的播放。

Flash与C#结合,打造完美WinForm程序

以其强大的交互性,以其漂亮的界面设计性,Adobe的Flash技术在互联网界已经被广大的开发者和用户所认可,如今很多酷炫的、功能强大的Flash页面已经出现在互联网上,为用户带来了完美的体验   但作为一项前端技术,我们同样希望它能更好的应用于桌面应用程序   我们都知道Adobe的AIR,它是Adobe推出的桌面应用程序开发技术,但由于它功能的局限性,并不被很多开发者认可   与此相比,我

jmxiaocai的专栏 2653

别再折腾端口了!Kali Nethunter Kex 图形化桌面连接失败的真正原因与一键修复(附Termux命令)

本文深入分析了Kali Nethunter Kex图形化桌面连接失败的真正原因,包括端口配置变更、依赖缺失和权限问题,并提供了一键修复方案和Termux命令。通过详细的诊断步骤和优化配置,帮助用户快速恢复Kex功能,提升移动安全测试效率。

weixin_42530732的博客 417

UVC协议在STM32H7上的移植实战案例

手把手带你把UVC协议移植到STM32H7平台,重点解决USB高速枚举、视频流控制与YUV数据打包等关键问题。基于HAL库实现符合UVC 1.5规范的即插即用摄像头功能,让嵌入式设备轻松变身标准UVC视频源。

weixin_42437253的博客 397

基于单片机自行车码表控制系统设计

*单片机设计介绍,基于单片机自行车码表控制系统设计。

QQ2193276455的博客 1488

Intel Atom x5-E8000嵌入式方案选型与设计复盘

在嵌入式系统设计中,处理器选型往往决定产品成败。低功耗x86平台凭借成熟的生态和工业级稳定性,成为工业计算机、边缘网关等设备的重要选择。Intel Atom x5-E8000虽然性能参数不抢眼,但5W TDP、宽温范围、长期供货等特性,使其在无风扇设计中展现出独特价值。从供电时序、内存布线到散热设计、固件适配,每个环节都需严格验证,才能保证长期稳定运行。本文基于实际项目,复盘了基于该处理器的完整开发流程,并与ARM方案进行对比,为相关产品设计提供参考。

weixin_34341229的博客 312

RouterOS网桥VLAN实战:从零构建安全隔离的二层虚拟网络

本文详细讲解了如何在RouterOS上利用网桥和VLAN功能,从零开始构建安全隔离的二层虚拟网络。通过分步实战演示,涵盖核心概念、网桥创建、PVID设置、VLAN规则配置及安全过滤,帮助网络管理员实现办公、访客与服务器网络的逻辑隔离与灵活管理,提升网络安全性。

u9v0w的博客 504

机器人强化学习入门学习笔记

如果你追求高精度动力学仿真、用于强化学习或机器人研究,MuJoCo 是一个非常优秀的选择。如果需要快速实验、使用真实机器人模型,PyBullet 或 Gazebo可能更合适;如果你追求大规模并行训练,Isaac Gym 或 BraX会更高效。legged gym底层是​编辑isaacgym,基于gpu训练可以多环境并行训练,收敛到一个稳定行走的策略快。本视频MuJoCo基于cpu训练很慢。

xiaomu_347的博客 1468

C#操作Flash动画

对于在C#开发的过程中没有接触过Flash相关开发的人员来说,没有系统的资料进行学习,那么这篇文档针对于初学者来说是很好的学习DEMO。 本文章中的DEMO实现了C#的COM控件库中本来就带有对flash进行播放的控件,只是需要对flash的相关操作进行了解即可,先看看实现的效果。 阅读目录 实现效果 配置Flash的运行环境 实现逻辑 C#操作Flash的关键参数...

weixin_30852451的博客 585

【华为OD机试真题】6、数组去重和排序 | 机试真题+思路参考+代码解析(C++、Java、Py、C语言、JS)

题目描述 >给定一个乱序的数组,删除所有的重复元素,使得每个元素只出现一次,并且按照出现的次数从高到低进行排序,相同出现次数按照第一次出现顺序进行先后排序

KJ.JK 3888

在Winform(C#)中使用Flash控件

因为项目实战的任务,要用到flash,以前也没怎么用过Falsh控件,加上VS2005跟Flash控件好像有Bug,费了好多时间查资料 加上老师的要求要不Flash数据封装到类里面,倒是费了不少的事 因为还要数据存入系统缓存,显得好麻烦,不过没发,说是培训我们面向对象的思想,也只有照做了 关于添加Flash控件这里就不介绍了,网上能查到一大堆 VS2005在添加Shoc...

weixin_30258027的博客 368

uniapp - 实现移动端H5微信公众号网页内置浏览器中预览和下载word文档(doc)、excel表格(xls)、ppt文稿、pdf文档等文件,微信内部打开预览和下载到本地详教程,兼容安卓苹果手机

uni-app,微信公众号,h5,移动端,web平台端,网页,网站,Uniapp微信公众号H5网站,内置浏览器下载文档,如何在微信浏览器中预览office文件,word文档,excel文档,pdf文档,ppt文档,office,微信内置浏览器下载文件,下载文件,在微信浏览器里面实现下载任意文件,H5需要在微信浏览器中下载excel文件,UniApp实现网页在微信内置浏览器中下载文件详细教程,安卓点击下载会提示打开浏览器,后端返回流文件,如何解决无法下载文件,跳转至浏览器下载文件,发送到电脑微信,安卓,苹果,

🏆 前端领域优质创作者 1万+

python实现序列比对之Needleman-wunsch算法 (附完整源码)

python实现序列比对之Needleman-wunsch算法 (附完整源码)

希望我的博客,能帮上你解决学习中工作中所遇到的问题 461

C#与 Flash 程序开发

  可以尝试以下关键字进行搜索查找其他资料关键字(C#, FLASH, winform,flash嵌入C# ,FLASH 开发UI界面 )要在c# winform程序里嵌入FLASH,其实就是直接引用Flash的ocx控件。那你就需要使用“COM 组件” Shockwave F

lizhifiy的专栏 1663

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

C# 播放Flash。调用MicroSoft ActiveX

Flash播放 首先要确认计算机中有Flash插件,就是IE浏览器浏览网页时能够播放Flash。其实播放Flash时使用了Macromedia公司提供的一个ActiveX组件,该ActvieX组件是SWFLASH.OCX.在系统目录中能够找到。将其引用到项目中,添加步骤如下: 1.选择“工具箱”,单击鼠标右键,在弹出的快捷菜单中选择“选择项”。 2.弹出“选择工具箱项”对话框,选择...

weixin_30583563的博客 221

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

Probability and Statistics - 4th edition

Probability and Statistics - 4th edition

上一篇: 对开发的程序(制作CAB)进行签名,并允许网站中使用
下一篇: AxWindowsMediaPlayer媒体文件主要方法属性
dadou2007
博客等级 码龄20年 6粉丝 13原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值