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

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

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值