Help: Can't display a image on a picturebox in an UserControl throughIE

C

Cinquini

Hi. I'm trying t display a LOCAL image (i.e. on a hard disk) in a web
browser using a embedded user control.

here's the code:

namespace MDIPictureBox
{
public partial class MDIPicBox : UserControl
{
private string imageName = "";
private PictureBox p;
Label l;

public MDIPicBox()
{
//InitializeComponent();

p = new PictureBox();
p.Top = 50;
p.Left = 5;
p.Height = 400;
p.Width = 500;
this.Controls.Add(p);

l = new Label();
l.Top = 35;
l.Left = 5;
this.Controls.Add(l);
}

public string ImageName
{
set {
this.imageName = value;
p.ImageLocation = this.imageName;
p.Refresh();

l.Text = "testing";
l.Refresh();

}
}

}

}

I've compiled the cs with the command csc /t:library MDIPicBox.dll
as shown in http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=187

And finally here is the html code:

<html>
<head>
</head>
<body>
Here comes the object...
<OBJECT ID="MyObject1" style="width: 550px; height:
400px; border:
1px;"
CLASSID="HTTP://127.0.0.1/
MDIPicBox.dll#MDIPictureBox.MDIPicBox"
VIEWASTEXT>
<PARAM NAME="ImageName"
value="C:\Projetos\MDIPictureBox\Doc000026_Front2_CHQ.jpeg" >
</OBJECT>
</body>
</html>

All I've got is a white box with a disabled vertical scrool bar. Even
qhen aI comment out the picturebox generation code, the label isn't
shown.

Could anyone give me some help? I pretty sure that here's a problem
with security, but what I have to change? In with place? Or there's a
problem in code?

Thanks in advance and excuse me my poor English. It's not my first
language.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top