当前位置: 网学 > 编程文档 > VB > 正文

用VB编RM格式压缩软件

来源:Http://myeducs.cn 联系QQ:点击这里给我发消息 作者: 用户投稿 来源: 网络 发布时间: 12/10/16
下载{$ArticleTitle}原创论文样式

作者:绿茗

一天看到一篇文章,说到RM格式的文件能通过控件prct3260.ocx格式压缩。为此,我把该控件加入VB窗体,通过object browser对象浏览器认真分析其属性事件和方法。现编一个小程序,让大家共享。
运行界面如下图所示:

两个文本框分别为txtopen,txtsave,浏览两个按钮为cmdopen,cmdsave,开始、停止和退出按钮:cmdstart,cmdstopt,cmdexit,三个显示状态label,lblface, lblfacemul,lbltime。还有一些label。
下面为源程序
Option Explicit
Dim i As Integer, j As Integer, k As Integer
Private Sub cmdexit_Click()
Unload Me
End Sub
Private Sub cmdopen_Click()
On Error Resume Next
dlg1.DialogTitle = "请选择制作的文件"
dlg1.ShowOpen
txtopen.Text = dlg1.FileName
If Trim(txtopen.Text) <> "" Then
cmdsave.Enabled = True
cmdstart.Enabled = True
txtsave.Text = Mid(txtopen.Text, 1, InStr(txtopen.Text, ".")) & "rm"
lblface.Caption = "选择文件开始"
End If
End Sub
Private Sub cmdsave_Click()
dlg2.DialogTitle = "请输入要保存的文件"
dlg2.ShowOpen
txtsave.Text = dlg2.FileName + ".rm"
End Sub
Private Sub cmdstart_Click()
ProducerControl1.InputFilename = ""
ProducerControl1.OutputFilename = ""
ProducerControl1.InputFilename = txtopen.Text
ProducerControl1.OutputFilename = txtsave.Text
ProducerControl1.StartEncoding
lblfacemul.Caption = "共1个文件"
cmdstart.Enabled = False
cmdsave.Enabled = False
cmdopen.Enabled = False
cmdstop.Enabled = True
lblface.Caption = "压缩开始."
lbltime.Caption = "00:00:00"
Timer1.Enabled = True
i = 0
j = 0
k = 0
End Sub
Private Sub cmdstop_Click()
ProducerControl1.StopEncoding
cmdsave.Enabled = False
cmdopen.Enabled = False
lblface.Caption = "用户停止"
cmdstart.Enabled = True
cmdstop.Enabled = False
cmdopen.Enabled = True
cmdsave.Enabled = True
Timer1.Enabled = False
lblfacemul.Caption = "共压缩1个文件"
End Sub
Private Sub Form_Load()
Timer1.Enabled = False
Timer1.Interval = 1000
cmdstart.Enabled = False
cmdstop.Enabled = False
cmdsave.Enabled = False
dlg1.Filter = "Media Files(*.dat;*.mov;*.mp3;*.avi)|*.dat;*.mov;*.mp3;*.avi|Mpeg Files(*.mpg;*.mpeg;*.mpa;*.mp2;*.mp3)|*.mpg;*.mpeg;*.mpa;*.mp2;*.mp3|QuickTime Files(*.mov;*.qt)|*.mov;*.qt|Audio Files(*.wav;*.au)|*.wav;*.au"
dlg1.FilterIndex = 1
dlg1.InitDir = App.path
dlg2.Filter = "RM格式(*.rm)|*.rm"
txtopen.Text = ""
txtsave.Text = ""
ProducerControl1.InputType = INPUT_SOURCE_FILE ''压缩文件
ProducerControl1.TempDirectory = "c:\windows\temp" ''暂存目录
lblface.Caption = "请选择文件"
lbltime.Caption = "00:00:00"
ProducerControl1.Target256KDSLCableModem = True ''目标听从为256线缆
ProducerControl1.InputDoAudio = True ''音频输入为真
ProducerControl1.InputDoVideo = True ''视频输入为真
ProducerControl1.AudioContent = AUDIO_CONTENT_VOICE_BACKGROUND ''声音和背景音乐
ProducerControl1.VideoQuality = VIDEO_QUALITY_SMOOTH_MOTION ''平滑图象
End Sub
Private Sub ProducerControl1_OnEnco
  • 上一篇资讯: 用VB制作TopMost类型窗口
  • 下一篇资讯: 用VB做定时断线程序
  • 网学推荐

    免费论文

    原创论文

    浏览:
    设为首页 | 加入收藏 | 论文首页 | 论文专题 | 设计下载 | 网学软件 | 论文模板 | 论文资源 | 程序设计 | 关于网学 | 站内搜索 | 网学留言 | 友情链接 | 资料中心
    版权所有 QQ:3710167 邮箱:3710167@qq.com 网学网 [Myeducs.cn] 您电脑的分辨率是 像素
    Copyright 2008-2015 myeducs.Cn www.myeducs.Cn All Rights Reserved
    湘ICP备09003080号