小说网 找小说 无限小说 烟雨红尘 幻想小说 酷文学 深夜书屋

利用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

Sub Form_Load()
Me.Move 0, 0, 11000, 8500
Set pic1 = Controls.Add("vb.picturebox", "pic1", Me)
With pic1
.Visible = True
.Move 3600, 2700, 3600, 2700
.ScaleMode = 3
.Appearance = 0
.BackColor = Me.BackColor
.CurrentX = 0
.CurrentY = 0
.FontSize = 60
.ForeColor = vbBlue
.FontName = "隶书"
End With
End Sub


Sub Form_Click()
Dim w As Integer, h As Integer
pic1.Print "人之初" & vbCrLf & "性本善"
w = pic1.ScaleWidth
h = pic1.ScaleHeight
StretchBlt Me.hdc, w, h, -w, h, pic1.hdc, 0, 0, w, h, SRCCOPY
StretchBlt Me.hdc, 3 * w, h, -w, h, pic1.hdc, 0, 0, w, h, SRCCOPY
StretchBlt Me.hdc, w, h, w, -h, pic1.hdc, 0, 0, w, h, SRCCOPY
StretchBlt Me.hdc, w, 3 * h, w, -h, pic1.hdc, 0, 0, w, h, SRCCOPY
End Sub

 

效果如下:


posted on 2004-09-16 19:30  王峰炬  阅读(112)  评论(0编辑  收藏  举报

导航