HOME

Draw text into an image with Visual Fox pro and GdPicture ActiveX

 

LOCAL Imaging,;
sText,;
nXtextDest,;
nYTextDest,;
nFontStyle,;
nTextColor,;
sFontName,;
nFontHeight

 

Imaging = CREATEOBJECT("gdpicturepro5.Imaging")
Imaging.SetLicenseNumber("0012345678910111213141516") &&Demo code version

nXtextDest = 50
nYTextDest = 100
nFontStyle = 0 &&standard
nFontHeight = 20
nTextColor = Imaging.ARGB(150,0,0,0) &&Black with semi transparence
sFontName = "Arial"

Imaging.CreateImageFromFile("c:\test.jpg")
Imaging.DrawText("Antialiased Hello World", nXtextDest , nYtextDest , nFontHeight, nFontStyle, nTextColor , sFontName , .T.)
Imaging.SaveAsJpeg("c:\test2.jpg", 80) &&Save the result to c:\test2.jpg
Imaging.CloseNativeImage()

RELEASE Imaging