明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1258|回复: 0

[转帖]三维字的实现

[复制链接]
发表于 2003-10-19 22:37:00 | 显示全部楼层 |阅读模式
使用Windows的API函数DrawState可以轻松实现字体的三维效果。
请看下面的程序:
>>步骤1----建立新工程,在窗体上放置一个CommandButton按钮。
>>步骤2----编写如下代码:

Private Const DST_TEXT = &H1
Private Const DSS_DISABLED = &H20
Private Declare Function DrawState Lib "user32" Alias _
"DrawStateA"(ByVal hDC As Long, ByVal hBrush As Long, _
ByVal lpDrawStateProc As Long, ByVal lParam As String, _
ByVal wParam As Long, ByVal n1 As Long, ByVal n2 As _
Long, ByVal n3 As Long, ByVal n4 As Long, ByVal un As _
Long) As Long

Private Sub Command1_Click()
Dim FontStr As String

Me.AutoRedraw = True
FontStr = "本站网址:Majifeng.Top263.net"
FontSize = 25
DrawState Me.hDC, 0, 0, FontStr, LenB(StrConv(FontStr, _
vbFromUnicode)), 10, 80, 0, 0, DST_TEXT Or DSS_DISABLED
Me.Refresh
End Sub

>>步骤3----编译运行,看到效果了吗?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-11-28 12:35 , Processed in 0.168860 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表