1、多媒体软件设计技术实验报告书课程名称: 多媒体软件设计技术 班 级: 学 号: 姓 名: 指导教师: 二一一 年 四 月一实验的目的1 使学生通过试验,掌握界面的设计方法,掌握常用控件的属性、事件、方法,理解 事件驱动的概念。2掌握图形、图像程序设计方法;3掌握多媒体音频、视频程序的设计方法;二实验项目实验二 VB 图像处理程序的设计1、实验目的通过本实验,要求掌握 VB 图形、图像处理程序设计的基本方法2、实验内容:图片百叶窗效果1)设计界面2)运行界面1.水平式2.垂直式 3.交互式3)属性设置控件名称 属性名称 属性值Caption 图片的百叶窗效果Backcolor &H0000FFF
2、F&(黄色)窗体Startupposition 2屏幕中心Name ps图片框控件 1AutoSize TrueName pd图片框控件 2AutoSize TrueName shuiping命令按钮 1Caption 水平Name chuizhi命令按钮 2Caption 垂直Name jiaohu命令按钮 3Caption 交互命令按钮 4 Name clearCaption 清除Name quit命令按钮 5Caption 退出4)程序源代码1.通用代码段:调用系统 BitBlt 函数,将原始图片拷贝到第二个 picturebox 中去。Const xTimes = 5Const COP
3、Y_PUT = &HCC0020 表示图片直接拷贝Private Declare Function BitBlt Lib “gdi32“ (ByVal hDestDC As Long, _ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, _ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, _ByVal ySrc As Long, ByVal dwRop As Long) As Long2.垂直按钮Private Sub chuizhi_Click()Di
4、m H As Long, W As LongDim i As Long, j As Long, m As Long, n As LongH = Ps.ScaleHeightW = Ps.ScaleWidthFor i = 0 To (xTimes - 1)For j = i To W Step xTimesBitBlt Pd.hDC, j, 0, 1, H, Ps.hDC, j, 0, COPY_PUTDelay 80000Next jNext iEnd Sub3.水平按钮Private Sub shuiping_Click()Dim H As Long, W As LongDim i As
5、Long, j As Long, m As Long, n As LongH = Ps.ScaleHeightW = Ps.ScaleWidthFor i = 0 To (xTimes - 1) 双重循环For j = i To H Step xTimesBitBlt Pd.hDC, 0, j, W, 1, Ps.hDC, 0, j, COPY_PUTDelay 80000Next jNext iEnd Sub4.交互按钮Private Sub jiaohu_Click()Dim H As Long, W As LongDim i As Long, j As LongH = Ps.ScaleH
6、eightW = Ps.ScaleWidthFor i = 0 To xTimes - 1 For j = i To H Step xTimesBitBlt Pd.hDC, j, 0, 1, H, Ps.hDC, j, 0, COPY_PUTBitBlt Pd.hDC, 0, j, W, 1, Ps.hDC, 0, j, COPY_PUTDelay 80000Next jNext iEnd Sub5.退出按钮Private Sub quit_Click()EndEnd Sub6.清除函数Private Sub clear_Click()Pd.ClsEnd Sub7.窗体加载Private Sub Form_Load()Ps.Picture = LoadPicture(App.Path & “abc.jpg“) 在程序所在磁盘内,自动加载图片 abc.jpgEnd Sub8.延迟函数Private Sub Delay(ByVal t As Long) 延时子过程,以便于能看清楚切换效果。Dim i As LongFor i = 0 To tNextEnd Sub