powered by
Image
drawText draws text over an Image object. This operation is destructive: it changes irreversibly the Image object and cannot be undone.
drawText
drawText( image, text, x, y, font_face = "simplex", font_scale = 1, italic = FALSE, color = "red", thickness = 1, bl_orig = TRUE )
An Image object.
A character string representing the text to be drawn.
A numeric value representing the x coordinate of the bottom left corner of the text string (or top left if bl_orig == TRUE).
bl_orig == TRUE
A numeric value representing the y coordinate of the bottom left corner of the text string (or top left if bl_orig == TRUE).
A character string representing the font type of the text (default: "simplex"). See notes for a list of available font types.
A numeric value representing the scale factor by which the font-specific base size is multiplied (default: 1).
A logical specifying whether the text should italicized (default: FALSE).
Any kind of R color specification compatible with col2bgr representing the color of the line (default: "red").
col2bgr
A numeric value representing the thickness in pixels of the line (default: 1).
A logical specifying the origin of the text drawing (default: TRUE). If TRUE, the text is drawn right-side-up. If FALSE, it is drawn upside-down.
This function does not return anything. It modifies image in place.
image
Image, getTextSize
getTextSize
# NOT RUN { balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision")) drawText(balloon, "I'm a balloon", 50, 50, thickness = 3) # }
Run the code above in your browser using DataLab