VBGood网站全文搜索 Google

搜索VBGood全站网页(全文搜索)

VB爱好者乐园(VBGood)

 找回密码
 立即注册
搜索
查看: 485|回复: 1

VB6升级到VB2008,函数BITBLT被警告未升级

[复制链接]
发表于 2017-9-27 11:40:45 | 显示全部楼层 |阅读模式
Option Strict Off
Option Explicit On
Friend Class BITBLT功能演示COPY
    Inherits System.Windows.Forms.Form
        Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Integer, ByVal x As Integer, ByVal y As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal hSrcDC As Integer, ByVal xSrc As Integer, ByVal ySrc As Integer, ByVal dwRop As Integer) As Integer
        Dim dwRopdd As Object
       
        Private Sub Command1_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command1.Click '拷贝练习
                Dim a As Object
                Dim FL As String
                FL = "E:\程序语言\VBpic\YUYU.BMP" '图片文件320*200
        Picture1.Image = System.Drawing.Image.FromFile(FL)
        BitBlt(Picture2.hdc, 0, 0, 320, 200, Picture1.hdc, 0, 0, vbSrcCopy)

        End Sub
End Class
 楼主| 发表于 2017-9-27 11:43:46 | 显示全部楼层
对应的VB6程序代码:
Option Explicit
'Private Declare Function PrintWindow Lib "user32" (ByVal hWnd As Long, ByVal hdcBlt As Long, ByVal nFlags As Long) As Long
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 Long
Dim dwRopdd

Private Sub Command1_Click()  '拷贝练习
Dim a, FL$
FL$ = "E:\程序语言\VBpic\YUYU.BMP" '图片文件320*200
Picture1.Picture = LoadPicture(FL$)
'PrintWindow(hwnd, destinationDC, PW_CLIENTONLY
'a = PrintWindow(395116, Picture1.hdc, 0)
BitBlt Picture2.hdc, 0, 0, 320, 200, Picture1.hdc, 0, 0, vbSrcCopy
'SavePicture Picture2.Image, "E:\程序语言\VBpic\夜景4c.bmp"
End Sub
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

文字版|手机版|小黑屋|VBGood  

GMT+8, 2017-10-23 17:44

VB爱好者乐园(VBGood)
快速回复 返回顶部 返回列表