Jump to content

Suggestion: insert text with color in background


Recommended Posts

Shortly: it could be nice to have ability to put text on image together with background color (selected in Colors tool). Where it can be useful: to make memes, to put labels on image, to put any text, which you don't want to intersect with picture. Just "shadow" is not enough, it should be solid BG, which easy distinct from underlying pixels.

Link to comment
Share on other sites

This is simple to accomplish with layers:

  • Top layer:      Text
  • Middle layer: Text background colour
  • Bottom layer: Image

Doing this allows you to make the coloured text background area any size or shape that you want.

 

 



Alternatively you could use @BoltBait's Meme Maker plugin. Although it doesn't create a solid coloured background, it does provide letter outlining and an option for shadowing, which together makes the text stand out from the underlying pixels.
 

 

Link to comment
Share on other sites

5 hours ago, toe_head2001 said:

 

You're missing using statements on most of those disposable objects.

 

My official recommendation has been "don't worry about it". I am very particular about this in my own coding, but I have designed the Direct2D (et. al.) wrappers with not-using-using in mind. You have to be very careful when to employ using so that you don't dispose something already owned elsewhere, or you have to know when to use CreateRef() to create your own lifetime/ownership management proxy, etc. etc. So instead of writing up a big wad of documentation on all of this, which will make things extra complicated for most plugin developers and with almost no benefit, I just say "don't worry unless you see performance being a huge concern, and you can prove it's due to excess garbage collection."

 

GPU plugins can run slow if you have them doing complicated stuff, but it won't be because of the garbage collector. After OnCreateOutput() or OnDraw() is called, the tiles are rendered without your involvement, and any slowness there won't be GC related. The number of Direct2D (et. al.) objects created by a plugin is actually very very small.

 

If you're implementing a Direct2DControl in a custom plugin UI then your OnRender() should definitely employ using. Because that method (hopefully) gets called 60 times per second, so the garbage really piles up.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...