C#GDI+图元组态和IronPython脚本应用之LED影像系统
来源:互联网 发布:梦想是什么 知乎 编辑:程序博客网 时间:2024/04/29 06:19
这段时间一直进行LED影像系统紧张的开发工作,目前成绩还是非常“斐然”的,终于有了一点透气的机会:)
该系统从技术角度来说包括三点:一是图元组态(这点和普通的组态软件没有什么区别,由于面对的用户技术层次相对较低,所以把原来嵌入式组态修改属性的属性列表,修改为属性面板,以直观的方式修改组件属性);二是图片特效制作,图片特效主要是淡入淡出、旋转、晶格、移动、放缩等等;三是IronPython脚本,该脚本为C#语言开发,是作者为了证明C#效率不行而开发的代码,没有想到事与愿违,效率反而出奇的好,被微软收编后,推出了开源的IronPython脚本,该脚本最大的特点就是和C#无缝集成,可以引用C#所有的库,就如C#本身引用一样,此外还能直接引用C#自己开发的库(其实和系统库的引用没有本质区别),本系统就采用了该脚本进行特效处理,这样系统的特效完全实现了定制,并且接口丰富,应对能力极强。
这是脚本特效编辑器(下图)
这是特效具体的一个脚本代码:
def process():
if this.RunState == 0:
Init()
this.RunState = 1
this.Image = this.Data.BmpImage
this.Total = 80 / (this.Rate + 1)
this.Current = this.Current + 1
dw=BitmapProcess.GetDiagonalWidth(this.Image.Width,this.Image.Height)
ds = (float)(dw) / this.Total
width = ds * (this.Current + this.Total / 2)
bmp = BitmapProcess.OpenBevel(this.Image, Orientation_Bevel.TopLeft, width, Color.Black)
bmp = BitmapProcess.OpenBevel(bmp , Orientation_Bevel.BottomRight, width, Color.Black)
bmp = BitmapProcess.OpenBevel(bmp , Orientation_Bevel.TopRight, width, Color.Black)
bmp = BitmapProcess.OpenBevel(bmp , Orientation_Bevel.BottomLeft, width, Color.Black)
this.Data.BmpImage = bmp
if width >= dw:
this.Current = this.Total + 1
def Init():
import clr
clr.AddReferenceByPartialName("System.Windows.Forms")
clr.AddReferenceByPartialName("System.Drawing")
clr.AddReferenceToFile("BitmapProcess.dll")
from System.Windows.Forms import *
from System.Drawing import *
from LBxSoft.Drawing import *
try:
process()
except:
print "Error"
if this.RunState == 0:
Init()
this.RunState = 1
this.Image = this.Data.BmpImage
this.Total = 80 / (this.Rate + 1)
this.Current = this.Current + 1
dw=BitmapProcess.GetDiagonalWidth(this.Image.Width,this.Image.Height)
ds = (float)(dw) / this.Total
width = ds * (this.Current + this.Total / 2)
bmp = BitmapProcess.OpenBevel(this.Image, Orientation_Bevel.TopLeft, width, Color.Black)
bmp = BitmapProcess.OpenBevel(bmp , Orientation_Bevel.BottomRight, width, Color.Black)
bmp = BitmapProcess.OpenBevel(bmp , Orientation_Bevel.TopRight, width, Color.Black)
bmp = BitmapProcess.OpenBevel(bmp , Orientation_Bevel.BottomLeft, width, Color.Black)
this.Data.BmpImage = bmp
if width >= dw:
this.Current = this.Total + 1
def Init():
import clr
clr.AddReferenceByPartialName("System.Windows.Forms")
clr.AddReferenceByPartialName("System.Drawing")
clr.AddReferenceToFile("BitmapProcess.dll")
from System.Windows.Forms import *
from System.Drawing import *
from LBxSoft.Drawing import *
try:
process()
except:
print "Error"
- C#GDI+图元组态和IronPython脚本应用之LED影像系统
- C#GDI+图元组态和IronPython脚本应用之LED影像系统
- C#GDI+图元组态和IronPython脚本应用之LED影像系统
- IronPython脚本调用C#dll示例
- IronPython脚本调用C#dll示例
- IronPython脚本调用C#dll示例
- IronPython应用之Linux(SSH和SCP,AutoPyTest自动化应用)
- GDI+学习之路6--图象、位图和图元文件
- GDI+学习之路6--图象、位图和图元文件
- 影像系统价值之我见
- 【在线应用】影像监测应用系统 “预告片”
- IronPython应用之WatiN(Web测试,AutoPyTest自动化测试)
- IronPython应用之WebAPI(Web测试,AutoPyTest自动化测试)
- IronPython应用之Selenium(Web测试,AutoPyTest自动化测试)
- GDI和GDI+的应用场合思考
- GDI+绘图技术应用之图形的保存和打印
- GDI+学习之路7--坐标系统和转换
- GDI+学习之路7--坐标系统和转换
- 圣诞节前发布的开源项目小结-欢迎补充
- Apache Geronimo 1.0 正式发布 - 明天来详细分析其组件
- 电子商务那里最赚钱?
- java swing 圆形按钮
- Sun推出自己的开源Java数据库
- C#GDI+图元组态和IronPython脚本应用之LED影像系统
- 爆强的专家系统游戏:能猜出你想的任何东西
- JBI - Java实现SOA的标准方法
- JSF中的设计模式
- RIA 和 AJAX,选择最合适的产品
- 老外又为了是否使用Spring吵了一天
- Jetspeed 2.0 Final 正式发布
- 提高精简框架集程序的性能
- 门户软件的价值不在门户本身