作者Berger927 (rabbit)
看板Visual_Basic
标题Re: [VB6 ] 有边框的字体
时间Tue Jan 9 20:17:34 2007
※ 引述《fumizuki (蒙面加菲狮)》之铭言:
: ※ 引述《Berger927 (rabbit)》之铭言:
: : 我用 picture.print 输入文字,但我想让字体有边框,我该怎摸做?
: : 我不想上下左右来回移动个8次贴图,因为我放在回圈中,资源会吃的太凶。
: : 不知道有没有比较快速的方法达成这个效果?
: : 在此先谢过~ ^^
哎呀,应该是我没说清楚,您误会我的意思了...
不过还是很感激您的热心,谢谢!
我是希望沿着字边的外围出现,而不是正方形围着一个字。
我原先的写法是这样,希望您能看的懂我想表达的意思。
Private Tmp As Long
Private Sub PrintStr(Str As String, Xx As Integer, Yy As Integer, Color As Long)
Tmp = ColorN(Color) 'ColorN为计算出Color的互补色Function
Call PrintText(Str, Xx - 1, Yy, Tmp) '背景字框
Call PrintText(Str, Xx + 1, Yy, Tmp)
Call PrintText(Str, Xx, Yy - 1, Tmp)
Call PrintText(Str, Xx, Yy + 1, Tmp)
Call PrintText(Str, Xx - 1, Yy - 1, Tmp)
Call PrintText(Str, Xx + 1, Yy + 1, Tmp)
Call PrintText(Str, Xx + 1, Yy - 1, Tmp)
Call PrintText(Str, Xx - 1, Yy + 1, Tmp)
Tmp = Color
Call PrintText(Str, Xx, Yy, Tmp) '前景字
End Sub
Private Sub PrintText(Str As String, Xx As Integer, Yy As Integer)
TempPic.Refresh '我把文字绘在TempPic里面
TempPic.CurrentX = Xx * 15
TempPic.CurrentY = Yy * 15
TempPic.Print Str
TempPic.Picture = TempPic.Image
End Sub
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 59.104.178.98
1F:推 fumizuki:我连这样的程式都不会写 囧a 01/09 21:09
2F:→ fumizuki:所以我也想不到更好的方法*_* 01/09 21:10
3F:→ Berger927:真觉得美工会整死程设人... 0rz 01/09 21:16