Article | 41023876 |
Type | HowTo |
Product | Engine |
Version | 5.0.1.1036 |
Date Added | 3/1/2005 |
Submitted by | Sasa Grebenar |
Keywords |
Option Explicit Private Declare Function SetROP2 Lib "gdi32" (ByVal hdc As Long, ByVal nDrawMode As Long) As Long Private Sub Command1_Click() Dim TStyle As vdTextstyle Set TStyle = VD.ActiveDocument.TextStyles(0) VD.ActiveDocument.SupportPath = "C:\Path_of_SHX_files\SHX;" TStyle.FontFile = "txt.shx" VD.CommandAction.CmdLine "user" End Sub Private Sub VD_CommandActionDraw(ByVal Render As VDStdLib5.vdRender, ByVal Action As VDStdLib5.VdConstCmdActions, ByVal referencePoint As VDStdLib5.vdxyz, ByVal currentPoint As VDStdLib5.vdxyz, Cancel As Integer) Dim TStyle As vdTextstyle Dim oldRop As Long Set TStyle = VD.ActiveDocument.TextStyles(0) VD.Actions.EnableTTF3dText = True oldRop = Render.Setrop(COPYPEN) SetROP2 Render.hdc, oldRop Render.Select_Pen VdPenSolid, 1, 0 Render.Drawtext "x: " & CStr(Format(currentPoint.x, "###0.000")) & " y: " & CStr(Format(currentPoint.y, "###0.000")), currentPoint.x, currentPoint.y - Render.PixelSize * 10#, 0, TStyle, Render.PixelSize * 9.2, 0, VdTextHorCenter, VdTextVerCen Render.Setrop INVERSE_PEN End Sub