Using jpg added as an item to the project
-
Hi, I'm trying to use an image file that was added to the project as an object as follows: Project --> Add existing item --> [Adding MyPic.jpg file to the project] Now the image file is an item within the project but what can I do with it? I guess it's possible to declair an image control to refer to this file (System.Web.UI.Image I= [what?] ) but I can't see how can I refer it? What's the difference between the properties of this item : None,Content,Compile,Embedded resource ? Can I erase the image file from my hard disk after I'm setting 'Compile' or 'Embedded resource' and still the picture appear ? Thanks
-
Hi, I'm trying to use an image file that was added to the project as an object as follows: Project --> Add existing item --> [Adding MyPic.jpg file to the project] Now the image file is an item within the project but what can I do with it? I guess it's possible to declair an image control to refer to this file (System.Web.UI.Image I= [what?] ) but I can't see how can I refer it? What's the difference between the properties of this item : None,Content,Compile,Embedded resource ? Can I erase the image file from my hard disk after I'm setting 'Compile' or 'Embedded resource' and still the picture appear ? Thanks
israeli wrote:
but I can't see how can I refer it?
You simply specify the URL of the image in the ImageUrl property of the Image control, you can also use the ellipsis button in the Properties window to locate the image. For more information, you can see: Adding Image Web Server Controls to a Web Forms Page[^]
israeli wrote:
What's the difference between the properties of this item : None,Content,Compile,Embedded resource ? Can I erase the image file from my hard disk after I'm setting 'Compile' or 'Embedded resource' and still the picture appear ?
You'd better check out the BuildAction property[^]