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