复制Picture里的内容包插控件保存为图片
Picture比较长或宽,超出屏幕,用滚动条显示,怎么把这个Picture的内容,包括控件一起保存为图片。
谢谢。
[解决办法]
Private Sub SaveToBMP_Click()
Dim NameWithPath As String
Dim PictureGetImg As FormMain
On Error GoTo Cancel
With CommonDialogBMP
.CancelError = True
.Filter = "Pictures (*.bmp)
[解决办法]
*.bmp"
.DefaultExt = "bmp"
.InitDir = App.Path
.FileName = "default"
.DialogTitle = "定义保存当前窗口画面文件名"
.Flags = cdlOFNOverwritePrompt
.ShowSave
NameWithPath = .FileName
End With
'If Trim(dir(NameWithPath)) = "" Then Exit Sub
DoEvents
keybd_event vbKeySnapshot, 1, 0, 0
DoEvents
'FormMain.Picture = Clipboard.GetData(vbCFBitmap)
SavePicture Clipboard.GetData(vbCFBitmap), NameWithPath
FormMain.Cls
Clipboard.Clear
Cancel:
Err.Clear
End Sub
试试看咯
[解决办法]
可以使用DirectX来获取。
[解决办法]
搜索下吧。我记得有个老贴,我贴过代码的。