利用API 实现 字符串的镜像(一)

类别:.NET开发 点击:0 评论:0 推荐:

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 Const SRCCOPY = &HCC0020
Private WithEvents pic1 As PictureBox
Private WithEvents pic2 As PictureBox


Sub Form_Load()
Me.Move 0, 0, 10200, 4000
Set pic1 = Controls.Add("vb.picturebox", "pic1", Me)
pic1.Visible = True
pic1.Move 0, 0, 5000, 2500
Set pic2 = Controls.Add("vb.picturebox", "pic2", Me)
pic2.Visible = True
pic2.Move 5000, 0, 5000, 2500
pic1.ScaleMode = 3
pic2.ScaleMode = 3
End Sub


Sub Form_Click()
pic2.CurrentX = 0
pic2.CurrentY = 0
pic2.FontSize = 120
pic2.ForeColor = vbRed
pic2.FontName = "隶书"
pic2.Print "镜像"
StretchBlt pic1.hdc, pic2.ScaleWidth, 0, -pic2.ScaleWidth, pic2.ScaleHeight, pic2.hdc, 0, 0, pic2.ScaleWidth, pic2.ScaleHeight, SRCCOPY
End Sub

本文地址:http://com.8s8s.com/it/it44071.htm