以文本方式查看主题
- Foxtable(狐表) (http://foxtable.net/bbs/index.asp)
-- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2)
---- [求助]FT语法格式问题 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=89740)
|
-- 作者:pcxjxjhkw
-- 发布时间:2016/8/29 9:57:00
-- [求助]FT语法格式问题
请问:FT语言格式与哪一种编程语言的语法是一致的?
vb代码如何转换为Ft?
谢谢
|
-- 作者:大红袍
-- 发布时间:2016/8/29 10:01:00
--
foxtable的是vb.net
vb转过来,基本相同,根据错误提示,去修改对应代码。
|
-- 作者:pcxjxjhkw
-- 发布时间:2016/8/29 10:05:00
--
谢
|
-- 作者:pcxjxjhkw
-- 发布时间:2016/8/29 10:48:00
--
有木有vb代码直接转vb.net?
|
-- 作者:pcxjxjhkw
-- 发布时间:2016/8/29 10:50:00
--
如何将以下代码转为vb.net?谢
\'创建视频窗口和连接摄像头 Dim nStyle As Long, T As Long
If ctCapWin = 0 Then \'创建一个视频窗口,大小:640*480 T = Me.ScaleY(Command1.Top + Command1.Height * 1.1, Me.ScaleMode, 3) \'视频窗口垂直位置:像素 \'nStyle = WS_Child + WS_Visible + WS_Caption + WS_ThickFrame \'子窗口(在Form1内)+可见+标题栏+边框 nStyle = WS_Child + WS_Visible \'视频窗口无标题栏和边框 \'nStyle = WS_Visible \'视频窗口为独立窗口,关闭主窗口视频窗口也会自动关闭 ctCapWin = capCreateCaptureWindow("我创建的视频窗口", nStyle, 0, T, 640, 480, Me.hWnd, 0) End If
\'将视频窗口连接到摄像头,如无后面两条语句视频窗口画面不会变化 SendMessage ctCapWin, WM_CAP_Connect, 0, 0 \'连接摄像头 SendMessage ctCapWin, WM_CAP_Set_PreView, 1, 0 \'第三个参数:1-预览模式有效,0-预览模式无效 SendMessage ctCapWin, WM_CAP_Set_PreViewRate, 30, 0 \'第三个参数:设置预览显示频率为每秒 30 帧 ctConnect = True: KjEnabled True \'"请检检查摄像头连接,并确定没有其他用户和程序使用."
|
-- 作者:大红袍
-- 发布时间:2016/8/29 11:06:00
--
Dim nStyle As Long, T As Long
If ctCapWin = 0 Then \'创建一个视频窗口,大小:640*480 T = Me.ScaleY(Command1.Top + Command1.Height * 1.1, Me.ScaleMode, 3) \'视频窗口垂直位置:像素 \'nStyle = WS_Child + WS_Visible + WS_Caption + WS_ThickFrame \'子窗口(在Form1内)+可见+标题栏+边框 nStyle = WS_Child + WS_Visible \'视频窗口无标题栏和边框 \'nStyle = WS_Visible \'视频窗口为独立窗口,关闭主窗口视频窗口也会自动关闭 ctCapWin = capCreateCaptureWindow("我创建的视频窗口", nStyle, 0, T, 640, 480, Me.hWnd, 0) End If
\'将视频窗口连接到摄像头,如无后面两条语句视频窗口画面不会变化 SendMessage(ctCapWin, WM_CAP_Connect, 0, 0) \'连接摄像头 SendMessage(ctCapWin, WM_CAP_Set_PreView, 1, 0) \'第三个参数:1-预览模式有效,0-预览模式无效 SendMessage(ctCapWin, WM_CAP_Set_PreViewRate, 30, 0) \'第三个参数:设置预览显示频率为每秒 30 帧 ctConnect = True
|
-- 作者:pcxjxjhkw
-- 发布时间:2016/8/29 11:35:00
--
老师:上面代码中仍报错。1.Me.ScaleY,2.capCreateCaptureWindow和SendMessage未定义。
是不是全局代码有问题?
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Long) As Long Private Declare Function capCreateCaptureWindow Lib "avicap32.dll" Alias "capCreateCaptureWindowA" (ByVal lpszWindowName As String, ByVal dwStyle As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hwndParent As Long, ByVal nID As Long) As Long Public ctCapWin As Long, ctAviPath As String, ctPicPath As String, ctConnect As Boolean \'视频窗口控制消息常数
Public Const WS_Child = &H40000000: Public Const WS_Visible = &H10000000 Public Const WS_Caption = &HC00000: Public Const WS_ThickFrame = &H40000 Public Const WM_User = &H400 \'用户消息开始号 Public Const WM_CAP_Connect = WM_User + 10 \'连接一个摄像头 Public Const WM_CAP_DisConnect = WM_User + 11 \'断开一个摄像头的连接 Public Const WM_CAP_Set_PreView = WM_User + 50 \'使预览模式有效或者失效 Public Const WM_CAP_Set_Overlay = WM_User + 51 \'使窗口处于叠加模式,也会自动地使预览模式失效. Public Const WM_CAP_Set_PreViewRate = WM_User + 52 \'设置在预览模式下帧的显示频率 Public Const WM_CAP_Edit_Copy = WM_User + 30 \'将当前图像复制到剪贴板 Public Const WM_CAP_Sequence = WM_User + 62 \'开始录像,录像未结束前不会返回. Public Const WM_Cap_File_Set_File = WM_User + 20 \'设置当前的视频捕捉文件 Public Const WM_Cap_File_Get_File = WM_User + 21 \'得到当前的视频捕捉文件
|
-- 作者:大红袍
-- 发布时间:2016/8/29 12:19:00
--
Private 改成 Public
Me.ScaleY 改成 e.Form.BaseForm.ScaleY
|
-- 作者:pcxjxjhkw
-- 发布时间:2016/8/29 19:27:00
--
老师,标红色的仍无法通过。
T = e.Form.BaseForm.ScaleY(Command1.Top + Command1.Height * 1.1, Me.ScaleMode, 3) \'视频窗口垂直位置:像素 \'nStyle = WS_Child + WS_Visible + WS_Caption + WS_ThickFrame \'子窗口(在Form1内)+可见+标题栏+边框 nStyle = WS_Child + WS_Visible \'视频窗口无标题栏和边框 \'nStyle = WS_Visible \'视频窗口为独立窗口,关闭主窗口视频窗口也会自动关闭 ctCapWin = capCreateCaptureWindow("我创建的视频窗口", nStyle, 0, T, 640, 480, Me.hWnd, 0)
|
-- 作者:Hyphen
-- 发布时间:2016/8/30 8:54:00
--
全局代码完整代码贴出来
|