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. Web Development
  3. ASP.NET
  4. verification image

verification image

Scheduled Pinned Locked Moved ASP.NET
graphicshelp
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.
  • M Offline
    M Offline
    Mohammed Elkholy
    wrote on last edited by
    #1

    hi , i try to draw a virification image on my page and i try some code and it worked alleady but the problem is all controls on the page not display i want to draw this but without i lose the page controls here the code i wrote // Initialize graphics Rectangle rectF = new Rectangle(0, 0, 100, 150); Bitmap pic = new Bitmap(100, 150); Graphics g = Graphics.FromImage(pic); g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; g.FillRectangle(new SolidBrush(Color.White), rectF); //g.DrawRectangle (Pens.Aqua , rectF); Font font = new Font("Times New Roman", 12); // Set font direction & alignmentString StringFormat format = new StringFormat(); format.Alignment = StringAlignment.Center; // Finally, draw the font g.DrawString(GenerateRendomText(), font, System.Drawing.Brushes.Black, rectF, format); //Response.ContentType = "image/jpeg"; // Set the content type Response.ContentType = "image/gif"; // Output the image to the OutputStream by using the Save method pic.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Gif); // Dispose objects pic.Dispose();

    MD_NADA

    H 1 Reply Last reply
    0
    • M Mohammed Elkholy

      hi , i try to draw a virification image on my page and i try some code and it worked alleady but the problem is all controls on the page not display i want to draw this but without i lose the page controls here the code i wrote // Initialize graphics Rectangle rectF = new Rectangle(0, 0, 100, 150); Bitmap pic = new Bitmap(100, 150); Graphics g = Graphics.FromImage(pic); g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; g.FillRectangle(new SolidBrush(Color.White), rectF); //g.DrawRectangle (Pens.Aqua , rectF); Font font = new Font("Times New Roman", 12); // Set font direction & alignmentString StringFormat format = new StringFormat(); format.Alignment = StringAlignment.Center; // Finally, draw the font g.DrawString(GenerateRendomText(), font, System.Drawing.Brushes.Black, rectF, format); //Response.ContentType = "image/jpeg"; // Set the content type Response.ContentType = "image/gif"; // Output the image to the OutputStream by using the Save method pic.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Gif); // Dispose objects pic.Dispose();

      MD_NADA

      H Offline
      H Offline
      Herman T Instance
      wrote on last edited by
      #2

      GenerateRendomText()? do you have a try/cach around this structure? And does the catch nog get reached?

      In Word you can only store 2 bytes. That is why I use Writer.

      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