VB6.0 怎么在Picture1里 Print 特殊字符?Picture1里 Print ☏☎ 显示?? 我用forms 2.0 的TextBox2 可以显示,但2.0 没有Picture 控件我是想用Picture1里 Print 字符来取点阵,其他字符已经完成,但 特殊字符不能显示。忘高手帮忙
解决方案 »
- 如何取0,1整数值
- 如何取得MSHFlexGrid某列的序号数字(送分)
- 请问怎样将label中的内容直接打印出来
- 谁可以告诉我Crystal Reports(水晶报表)有什么用的?我下载了一只Crystal Reports 9的简中文版,但不知道用途,谢谢
- +++++++++++广告类型++++++++++++++++++++++
- 在VB中对硬盘的底层操作大全(一)
- recordset、connection等的释放内存问题:是不是每用一次都要set =nothing?
- 我开发了一个信息系统软件,想用录像的形式演示给客户,让他们很快掌握操作方法,用什么视频制作软件好?
- 我的excel文件有宏代码,每次打开文件,都有该死的提示框,怎么把它去掉并默认允许宏???????
- 请问哪里还有同CSDN一样的讨论区?
- 求助,急
- VB 怎么运行一个外部 EXE 并使他不能别复制?
eg:
Dim i%
For i = 0 To 20
Picture1.Print Chr(i)
Next
Dim strText As String
strText = ChrW(9742) + ChrW(9743) + vbNullChar
Me.AutoRedraw = True
TextOutW Me.hdc, 10, 10, StrPtr(strText), 2
End Sub
编写如下代码:
MsgBox Asc(textBox1.Text)
可以获得内码,再写到程序里面。
江南春 你好 用你方法 可以再Picture 里打印特殊字符, 但现在又有一个问题 希望可以解答
Picture2.TextWidth(StrPtr(TextBox2.Text)) 用StrPtr函数后 Picture2.TextWidth只能输出 小于42 这是什么原因
Private Type Size
cx As Long
cy As Long
End Type
Private Declare Function TextOutW Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal lpString As Long, ByVal nCount As Long) As Long
Private Declare Function GetTextExtentPoint32W Lib "gdi32" (ByVal hdc As Long, ByVal lpsz As Long, ByVal cbString As Long, lpSize As Size) As Long
Private Declare Function lstrlenW Lib "kernel32" (ByVal lpString As Long) As LongPrivate Sub Form_Load()
Dim strText As String, nLen As Long, sizeText As Size
strText = ChrW(9742) + ChrW(9743) + vbNullChar
'获得字符串长度
nLen = lstrlenW(StrPtr(strText))
'在窗口中显示字符串
Me.AutoRedraw = True
TextOutW Me.hdc, 10, 10, StrPtr(strText), nLen
'获得字符串像素级宽度
GetTextExtentPoint32W Me.hdc, StrPtr(strText), nLen, sizeText
Debug.Print sizeText.cx
End Sub
Private Const SRCAND = &H8800C6
Private Const SRCCOPY = &HCC0020
Private Const SRCDECIMALBIND = 19
Private Const SRCERASE = &H440328
Private Const SRCPAINT = &HEE0086Private 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 LongPrivate Sub Command1_Click()
Dim lngP As Long
lngP = BitBlt(Picture1.hDC, 0, 0, TextBox1.Width / 2, TextBox1.Height / 2, Me.hDC, TextBox1.Left + 5, TextBox1.Top + 2, SRCAND)
End SubPrivate Sub Form_Load()
TextBox1.Text = ChrW(9742) + ChrW(9743)
Picture1.ScaleMode = 3
Me.ScaleMode = 3
End Sub
该例子使用了Forms2.0的TextBox控件。
Private Const SRCAND = &H8800C6
Private Const SRCCOPY = &HCC0020
Private Const SRCDECIMALBIND = 19
Private Const SRCERASE = &H440328
Private Const SRCPAINT = &HEE0086Private 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 LongPrivate Sub Command1_Click()
Dim lngP As Long
lngP = BitBlt(Picture1.hDC, 0, 0, TextBox1.Width / 2, TextBox1.Height / 2, Me.hDC, TextBox1.Left + 5, TextBox1.Top + 2, SRCAND)
End SubPrivate Sub Form_Load()
TextBox1.Text = ChrW(9742) + ChrW(9743)
Picture1.ScaleMode = 3
Me.ScaleMode = 3
End Sub
该例子使用了Forms2.0的TextBox控件。
cx As Long
cy As Long
End Type
Private Declare Function TextOutW Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal lpString As Long, ByVal nCount As Long) As Long
Private Declare Function GetTextExtentPoint32W Lib "gdi32" (ByVal hdc As Long, ByVal lpsz As Long, ByVal cbString As Long, lpSize As Size) As Long
Private Declare Function lstrlenW Lib "kernel32" (ByVal lpString As Long) As Long
Private Declare Function SetTextCharacterExtra Lib "gdi32" (ByVal hdc As Long, ByVal nCharExtra As Long) As LongPrivate Sub Form_Load()
Dim strText As String, nLen As Long, sizeText As Size
Me.AutoRedraw = True
strText = ChrW(9742) + ChrW(9743) + vbNullChar
'获得字符串长度
nLen = lstrlenW(StrPtr(strText))
'设置字间距
SetTextCharacterExtra Me.hdc, 20
'在窗口中显示字符串
TextOutW Me.hdc, 10, 10, StrPtr(strText), nLen
'获得字符串像素级宽度
GetTextExtentPoint32W Me.hdc, StrPtr(strText), nLen, sizeText
Debug.Print sizeText.cx
End Sub