vb问题,如何放大或缩小剪贴板中的图?
1个回答
展开全部
三步:
1 把剪贴板的图显示到PictureBox
2 用StretchBlt函数缩放图片
3 缩放后的图片再次放入剪贴板
1 把剪贴板的图显示到PictureBox
2 用StretchBlt函数缩放图片
3 缩放后的图片再次放入剪贴板
更多追问追答
追问
不太会用,举个例子吧?
追答
Private Declare Function StretchBlt Lib "gdi32" (ByVal hdc 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 nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal dwRop As Long) As Long
Private Sub Command1_Click()
Picture1 = Clipboard.GetData
StretchBlt Picture2.hdc, 0, 0, Picture2.Width - 1, Picture2.Height - 1, Picture1.hdc, 0, 0, Picture1.Width, Picture1.Height, vbSrcCopy
Clipboard.SetData Picture2
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询