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. Pixel/Points Units

Pixel/Points Units

Scheduled Pinned Locked Moved ASP.NET
comsysadminquestion
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.
  • J Offline
    J Offline
    Jon G
    wrote on last edited by
    #1

    I have an Image server control on my page. In my codebehind, I am trying to convert the Image.Height and Image.Width properties of that Image into a string. Can anyone tell me how this is done? I cannot find any correct way to convert the Unit type into a string. Jon G www.Gizmocoder.com

    J 1 Reply Last reply
    0
    • J Jon G

      I have an Image server control on my page. In my codebehind, I am trying to convert the Image.Height and Image.Width properties of that Image into a string. Can anyone tell me how this is done? I cannot find any correct way to convert the Unit type into a string. Jon G www.Gizmocoder.com

      J Offline
      J Offline
      Jon G
      wrote on last edited by
      #2

      I found out how to accomplish this task. Here is what I ended up doing (after a painful hour of brute forcing): I created a new image (not a webcontrol image, but a system.drawing image): Dim myImage As System.Drawing.Image = System.Drawing.Image.FromFile(UploadPath + NewPicName) The image was created from the network path. In my case it was an uploaded file. After this, everything got easy. Dim tempHeight = myImage.Height Dim tempWidth = myImage.Width For future reference, Webcontrol Images do not allow you to retrieve the height and width of an image. If it does, I would like someone to let me know how. Jon G www.Gizmocoder.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