' Draw an outline by drawing the text offset by
' one pixel in every direction. Then draw the text.
Private Sub OutlineText(ByVal obj As Object, ByVal txt As _
String, ByVal start_x As Single, ByVal start_y As _
Single, ByVal outline_color As OLE_COLOR, ByVal _
text_color As OLE_COLOR)
Dim i As Integer
Dim j As Integer
Dim pixx As Single
Dim pixy As Single
' Draw the outline by drawing the text
' moved 1 pixel in all directions.
pixx = obj.ScaleX(1, vbPixels, obj.ScaleMode)
pixy = obj.ScaleY(1, vbPixels, obj.ScaleMode)
obj.ForeColor = outline_color
For i = -1 To 1
For j = -1 To 1
obj.CurrentX = start_x + i * pixx
obj.CurrentY = start_y + j * pixy
obj.Print txt
Next j
Next i
' Draw the text at its desired location.
obj.ForeColor = text_color
obj.CurrentX = start_y
obj.CurrentY = start_x
obj.Print txt
End Sub
|