I am using ImageMagick to add text to an image and I need that text to be centered horizontally but I also want to be able to set the vertical position. My code that works but places the text 50 pixels from the left of the canvas edge is:
'This adds the address text block
image.Settings.FillColor = MagickColors.Transparent
image.Settings.StrokeColor = MagickColors.Transparent
image.Settings.FontPointsize = 195
image.Annotate("508 West Earl Street", New MagickGeometry(50, 300, 150, 75), Gravity.Undefined, 0)
I need the code to center it horizontally and make it 300px from the top vertically; something like below but I can't figure out what to put in place of the X coordinate to center it.
'This adds the address text block and should center it.
image.Settings.FillColor = MagickColors.Transparent
image.Settings.StrokeColor = MagickColors.Transparent
image.Settings.FontPointsize = 195
image.Annotate("508 West Earl Street", New MagickGeometry('This Value Needs to Center it', 300, 150, 75), Gravity.Undefined, 0)