An Example file is included, and the functions usage is:
TextToImage(In, Text, Output, XPos, YPos, Size, Align, Weight, Font, TColour, Style)
Header of the function:
; TextToImage v1.07 by tic ; ; TextToImage can overlay writing to a screenshot of the entire screen or active window, or from an existing image and write to file ; TextToImage(In, Text, Output, x, y, Font, TColour, Size, Weight) ; ; In: Can either be the "Screen" or "Window" and will take a screenshot of the respective choice, or the location of an exisitng image ; ; Text: This is the text to overlay onto the screenshot ; ; Output: This is the path and filename that the image will be written to. ; The extension can be .bmp,.jpg,.png,.tif,.gif and will be written as that type accordingly ; ; x: This is the x-coordinate to place the text. This coordinate will be the distance from the left the text will be placed. ; This value may be a ratio. For instance 4:5 would place the text at the position 4/5ths of the width of the image ; You must also consult which mode align is in ; ; y: This is the y-coordinate to place the text. This coordinate will be the distance from the top the text will be placed. ; This value may be a ratio. For instance 1:3 would place the text at the position 1/3ths of the height of the image ; You must also consult which mode align is in ; ; Size: This is the height of the text in pixels ; ; Align: This must have 2 styles set, The text's x placement (Left,Centre,Right) and the text's y placement (Top,Bottom) ; It must be used for example as Left|Bottom - This would place the text at the bottom of it's bounding area and aligned left ; ; Weight: This is the boldness of the text. Make the value greater to make it more bold ; ; Font: This is the font to set the text to be ; Examples are: Arial, Bookman Old Style, Times New Roman ; ; TColour: This is the colour to set the text in RGB format. ; So FF0000 is red ; ; Style: Can contain the words Underline,Italic,Strikeout and will set the text in the appropriate styles
None of the parameters are necessary, an example usage is:
TextToImage("Screen", "Some text", "file.png", "1:2", "1:2", 20, "Bottom|Centre", 400, "Arial", "ff0000", "Underline") ; Take an entire screenshot, overlay "some text" in the centre of the screen, aligned centre and bottom, in font arial, ; colour red, size 20, and underline it, and then save to "file.png"
<!-- m -->https://ahknet.autoh...TextToImage.zip<!-- m -->