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
  1. Home
  2. General Programming
  3. C#
  4. Watermarking an image, with embossed Effect & Colors of text should be same as source image have

Watermarking an image, with embossed Effect & Colors of text should be same as source image have

Scheduled Pinned Locked Moved C#
graphicscomarchitecturehelptutorial
1 Posts 1 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.
  • A Offline
    A Offline
    adnanrafiq
    wrote on last edited by
    #1

    Hi There, I am trying to watermark an image with Embossed text & with opacity of color. Here is code which i am using. Problem Description: Watermark & embossed look works K , but i want same color of text (little darker), as the source image have, any idea how to use color pellete of indexed image to draw text with its colors or any other solution, any tip will be highly appreciated. Image watermarkImage = null; using (watermarkImage = Image.FromFile(@"C:\NYDN 2008-02-18E\ENV13614\ENV13614 002P.tif")) { System.Drawing.Font myFont = new Font("Arial", 58, FontStyle.Bold); System.Drawing.Color myWatermarkColor = Color.FromArgb(120, 120, 120); Bitmap btmImage = new Bitmap(watermarkImage.Width, watermarkImage.Height); // Get a graphics context Graphics g = Graphics.FromImage(btmImage); g.DrawImage(watermarkImage, new Rectangle(0, 0, btmImage.Width, btmImage.Height), 0, 0, watermarkImage.Width, watermarkImage.Height, GraphicsUnit.Pixel); watermarkImage = btmImage; // Create a solid brush to write the watermark text on the image Brush blackBursh = new SolidBrush(Color.FromArgb(58, Color.Gray)); Brush whiteBursh=new SolidBrush(Color.FromArgb(58,Color.Black)); //Brush shadowBursh = new SolidBrush(Color.FromArgb(45, Color.Black)); int numofLayers = (int)(watermarkImage.Height / 100); int lineHeight = 0; for (int i = 0; i < numofLayers; i++) { g.DrawString("© Property of the New York Daily News.© Property of the New York Daily News.© Property of the New York Daily News..© Property of the New York Daily News.", myFont, blackBursh, 1, lineHeight+1); g.DrawString("© Property of the New York Daily News.© Property of the New York Daily News.© Property of the New York Daily News..© Property of the New York Daily News.", myFont, whiteBursh, 0, lineHeight); lineHeight += 100; } watermarkImage.Save(@"C:\temp.jpg"); } Regards, adnan

    Many Thanks, Adnan Rafiq muhammadadnanrafiq@gmail.com

    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