Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Inverted text on image

Inverted text on image

Scheduled Pinned Locked Moved C#
question
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kir Birger
    wrote on last edited by
    #1

    Is it possible to somehow draw text on an image with an inverted color? I basically want to make a small timestamp that always shows up, and I don't want to resort to putting it in a colored rectangle if I can avoid it. I've got access to framework 3.5 if that helps.

    A 1 Reply Last reply
    0
    • K Kir Birger

      Is it possible to somehow draw text on an image with an inverted color? I basically want to make a small timestamp that always shows up, and I don't want to resort to putting it in a colored rectangle if I can avoid it. I've got access to framework 3.5 if that helps.

      A Offline
      A Offline
      Anthony Mushrow
      wrote on last edited by
      #2

      Im not entirely certain that would be very readable either, with the changing colour and whatnot. What about an outline around the text? EDIT: But, if you want inverted text, then how about: ImageOne - original image ImageTwo - empty image with same dimensions as ImageOne, white background ImageThree - Duplicate of ImageOne Step one: Draw Text to ImageTwo in black Step two: Invert the colour of ImageThree Step three: Read the colour of each pixel in ImageTwo. If the colour is WHITE, then set the same pixel in ImageThree to bright pink or something (255,0,255) Step four: Set the transparency key of ImageThree to the same colour as before (in this case, [255,0,255]) Step five: Draw ImageThree on to ImageOne

      My current favourite word is: Bacon!

      -SK Genius

      modified on Saturday, April 12, 2008 11:02 AM

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups