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. Create Images from Web Page

Create Images from Web Page

Scheduled Pinned Locked Moved ASP.NET
question
2 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.
  • O Offline
    O Offline
    oskardiazdeleon
    wrote on last edited by
    #1

    I would lke to generate an image based from my webpage. Only the top 150 pixels by 40. Is there a way to take the designated pixels and take a screen shot into an image? thanks

    O 1 Reply Last reply
    0
    • O oskardiazdeleon

      I would lke to generate an image based from my webpage. Only the top 150 pixels by 40. Is there a way to take the designated pixels and take a screen shot into an image? thanks

      O Offline
      O Offline
      oskardiazdeleon
      wrote on last edited by
      #2

      Bitmap bmp = new Bitmap(Server.MapPath("web.jpg")); Graphics g = Graphics.FromImage(bmp); g.SmoothingMode = SmoothingMode.AntiAlias; //set Name g.DrawString(this.txtName.Text, new Font("Arial", 14), SystemBrushes.WindowText, 110, 10); //set Title g.DrawString(this.txtTitle.Text, new Font("Arial", 8), SystemBrushes.WindowText, 115, 30); //set Address g.DrawString(this.txtAddress.Text, new Font("Arial", 8), SystemBrushes.WindowText, 115, 55); //set web URl g.DrawString(this.txtWebURL.Text, new Font("Arial", 8), SystemBrushes.WindowText, Convert.ToInt16(this.TextBox1.Text), Convert.ToInt16(this.TextBox2.Text)); Response.ContentType = "image/gif"; bmp.Save(Response.OutputStream, ImageFormat.Jpeg); I figured out how to make this file. How do I make this applicaion download this file instead of displaying it on the screen? Right now it renders the image but when I try to download it windows OS doesnt recognise it as an image.

      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