Hello
I try something rather easy. Load an image, draw some text on it, output the image again.
Code simplified:
[code] Dim picFile As New FolderItem("/Users/mathiasmaes/Desktop/Schermveranderaar/lesverplaatsingen.png", FolderItem.PathTypeNative)
If picFile <> Nil Then
Dim pic As Picture
pic = Picture.Open(picFile)
pic = ModernizePicture(pic)
pic.Graphics.ForeColor = Color.Blue
pic.Graphics.TextUnit = FontUnits.Pixel
pic.Graphics.TextSize = 50
pic.Graphics.DrawString("M. Monteyne"), 60, 190)
Dim savelocation As New FolderItem("/Users/mathiasmaes/Desktop/Schermveranderaar/lesverplaatsingen1.png", FolderItem.PathTypeNative)
pic.Save(savelocation, Picture.SaveAsPNG)
End If[/code]
Original image:
Outputed image:
The text is on the right place, but the width is completely wrong, the original text on the image is way to small.
This probably has to do something with scaling or something, but I don’t know how to change this.
The code of modernizepicture is:
[code] Dim result As New Picture( input.Width, input.Height)
result.HorizontalResolution = input.HorizontalResolution
result.VerticalResolution = input.VerticalResolution
result.Graphics.DrawPicture( input, 0, 0 )
Return result[/code]