'
'
Imports Microsoft.VisualBasic
Imports System
Imports Matrox.MatroxImagingLibrary
Namespace MgraText
Friend Class Program
Shared Sub Main(ByVal args() As String)
Dim MilApplication As MIL_ID = MIL.M_NULL
Dim MilSystem As MIL_ID = MIL.M_NULL
Dim MilDisplay As MIL_ID = MIL.M_NULL
Dim MilImage As MIL_ID = MIL.M_NULL
Dim MilGraphicContextId As MIL_ID = MIL.M_NULL
MIL.MappAllocDefault(MIL.M_DEFAULT, MilApplication, MilSystem, MilDisplay, CType(MIL.M_NULL, IntPtr), MilImage)
MIL.MgraAlloc(MilSystem, MilGraphicContextId)
MIL.MgraColor(MilGraphicContextId, &HF0)
MIL.MgraFont(MilGraphicContextId, MIL.M_FONT_DEFAULT_LARGE)
MIL.MgraText(MilGraphicContextId, MilImage, 160L, 20L, " Welcome to MIL !!! ")
MIL.MgraControl(MilGraphicContextId, MIL.M_FONT_SIZE, 12)
MIL.MgraFont(MilGraphicContextId, MIL.MIL_FONT_NAME(MIL.M_FONT_DEFAULT_TTF))
MIL.MgraText(MilGraphicContextId, MilImage, 40L, 80L, "English")
MIL.MappControl(MIL.M_DEFAULT, MIL.M_ERROR, MIL.M_PRINT_DISABLE)
MIL.MgraControl(MilGraphicContextId, MIL.M_FONT_SIZE, 16)
MIL.MgraFont(MilGraphicContextId, MIL.MIL_FONT_NAME(MIL.M_FONT_DEFAULT_TTF + ":Bold"))
MIL.MgraText(MilGraphicContextId, MilImage, 40L, 140L, "Français")
MIL.MgraControl(MilGraphicContextId, MIL.M_FONT_SIZE, 24)
MIL.MgraFont(MilGraphicContextId, MIL.MIL_FONT_NAME(MIL.M_FONT_DEFAULT_TTF + ":Italic"))
MIL.MgraText(MilGraphicContextId, MilImage, 40L, 220L, "Italiano")
MIL.MgraControl(MilGraphicContextId, MIL.M_FONT_SIZE, 30)
MIL.MgraFont(MilGraphicContextId, MIL.MIL_FONT_NAME(MIL.M_FONT_DEFAULT_TTF + ":Bold:Italic"))
MIL.MgraText(MilGraphicContextId, MilImage, 40L, 300L, "Deutsch")
MIL.MgraControl(MilGraphicContextId, MIL.M_FONT_SIZE, 36)
MIL.MgraFont(MilGraphicContextId, MIL.MIL_FONT_NAME("Courier New"))
MIL.MgraText(MilGraphicContextId, MilImage, 40L, 380L, "Español")
If MIL.M_MIL_USE_TTF_UNICODE = 1 Then
MIL.MgraFont(MilGraphicContextId, MIL.MIL_FONT_NAME(MIL.M_FONT_DEFAULT_TTF))
MIL.MgraControl(MilGraphicContextId, MIL.M_FONT_SIZE, 12)
MIL.MgraText(MilGraphicContextId, MilImage, 400L, 80L, "ελληνιδ")
MIL.MgraControl(MilGraphicContextId, MIL.M_FONT_SIZE, 24)
MIL.MgraText(MilGraphicContextId, MilImage, 400L, 140L, "日本語")
MIL.MgraControl(MilGraphicContextId, MIL.M_FONT_SIZE, 16)
MIL.MgraText(MilGraphicContextId, MilImage, 400L, 220L, "한국어")
MIL.MgraControl(MilGraphicContextId, MIL.M_TEXT_DIRECTION, MIL.M_RIGHT_TO_LEFT)
MIL.MgraControl(MilGraphicContextId, MIL.M_FONT_SIZE, 30)
MIL.MgraText(MilGraphicContextId, MilImage, 400L, 320L, "עברית")
MIL.MgraControl(MilGraphicContextId, MIL.M_FONT_SIZE, 36)
MIL.MgraText(MilGraphicContextId, MilImage, 400L, 380L, "ﻋﺮﺑﻲ")
End If
Console.WriteLine()
Console.WriteLine("INTERNATIONAL TEXT ANNOTATION:")
Console.WriteLine("------------------------------")
Console.WriteLine()
Console.WriteLine("This example demonstrates the support of TrueType fonts by MgraText.")
Console.WriteLine()
If MIL.MappGetError(MIL.M_GLOBAL + MIL.M_SYNCHRONOUS, CType(MIL.M_NULL, IntPtr)) <> MIL.M_NULL_ERROR Then
Console.WriteLine("Note: Some Unicode fonts are not available")
Console.WriteLine()
End If
Console.WriteLine("Press <Enter> to end.")
Console.ReadKey()
MIL.MgraFree(MilGraphicContextId)
MIL.MappFreeDefault(MilApplication, MilSystem, MilDisplay, MIL.M_NULL, MilImage)
End Sub
End Class
End Namespace