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.
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.