Hi,
I am using VS2005, C#.
Am trying to populate an image in Image(control) at run-time.
The image to be populated is not fixed. It is decided by the a criterion in the previous page.
Can anyone help me with code snippets.
ch_nilanjan
0
Newbie Poster
Recommended Answers
Jump to PostSomething like this?
private void SetLogo(string logoPath) { try { pctLogo.Image = System.Drawing.Bitmap.FromFile(logoPath); } catch { } }
Jump to PostHi,
Please confirm if the variables used logoPath will contain the complete path of the image and pctLogo is an Image type variable.
Please confirmlogoPath is the complete path to the image.
pctLogo is a control of the type System.Windows.Forms.PictureBox, but the image-property is of the same type for …
Jump to PostAh, this question belongs in the ASP.NET forum instead of the C# forum. Please send those questions to the other forum in the future.
For html you need an <img ...> tag to display the image in the client browser.
Here is an example of the html from …
Jump to PostThat depends on how you know what the image name is .. is it part of your query string or a field in the postback etc? Just set the
img.Src = Request.QueryString["whatever"]
.. orimg.Src = textbox1.Text
All 13 Replies
djjaries
0
Newbie Poster
ch_nilanjan
0
Newbie Poster
djjaries
0
Newbie Poster
ch_nilanjan
0
Newbie Poster
sknake
1,622
Senior Poster
Featured Poster
ch_nilanjan
0
Newbie Poster
sknake
1,622
Senior Poster
Featured Poster
ch_nilanjan
0
Newbie Poster
sknake
1,622
Senior Poster
Featured Poster
ch_nilanjan
0
Newbie Poster
sknake
1,622
Senior Poster
Featured Poster
ch_nilanjan
0
Newbie Poster
ch_nilanjan
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.