Skip to content

Text background - highlighted text? #129

Answered by antonfirsov
ghost asked this question in Ideas
Discussion options

You must be logged in to vote

I don't think there is a simple out of the box way to achieve this.

I would do the following:

  • Load the background image (bgImage)
  • Create an image fgImage with a transparent background to draw the foreground on (text + highlighting)
  • Draw the lines separately on fgImage. For each line:
    • Use TextMeasurer to measure the boundary rectangle of each individual line
    • Draw a rectangle with the highlight color
    • Draw the text line
  • fgImage.Mutate(c => c.Skew(...))
  • Draw fgImage over bgImage (fgImage's background is transparent)

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@ghost
Comment options

@ghost
Comment options

@antonfirsov
Comment options

@JimBobSquarePants
Comment options

@ghost
Comment options

Answer selected by JimBobSquarePants
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants