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. Image - help me please

Image - help me please

Scheduled Pinned Locked Moved C#
helpquestion
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
    Moon Boy
    wrote on last edited by
    #1

    Well, in my program, the user type the path of the image. string with the path is: imagepath I tryed: Image img = Image.FromFile( imagepath ); but this ONLY WORKS if the IMAGEPATH ( users type ) is the SAME of the PROGRAM PATH. If the program path is different, this doesnt work... So i tryed a FileStream and Image.FromStream, same problem, only works if the program path = IMAGEPATH What can i do? Thanks.

    J 1 Reply Last reply
    0
    • M Moon Boy

      Well, in my program, the user type the path of the image. string with the path is: imagepath I tryed: Image img = Image.FromFile( imagepath ); but this ONLY WORKS if the IMAGEPATH ( users type ) is the SAME of the PROGRAM PATH. If the program path is different, this doesnt work... So i tryed a FileStream and Image.FromStream, same problem, only works if the program path = IMAGEPATH What can i do? Thanks.

      J Offline
      J Offline
      Jay Shankar
      wrote on last edited by
      #2

      Hi Moon B, Image img = Image.FromFile( imagepath ); In place of "imagepath" you can enter 1. image file name with extension like "mypic.bmp", "mypic1.ico" etc or. 2. You can enter the image full path like Image.FromFile(@"C:\Jay Code\mypic.bmp") In Case 1 mypic should be in Application's Main/Bin/Debug folder where exe is being stored. In case 2 it takes absolute bath that is why application directory does not matter. Try the code mentioned in 2, if it does not work revert back.. Jay

      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