C
Clas Hortien
Hi,
i have a array of uint[] and want to display this array as a
System.Web.UI.WebControls.Image.
//=========================================
uint [] ar = new uint[3072];
string fName;
System.Web.UI.WebControls.Image i = new System.Web.UI.WebControls.Image();
vm.Display._GenerateThumbnail(ar);
fName = "c:\\temp\\f_" + vm.Name + ".bmp";
SaveArrayToFile(ar,fName);
i.ImageUrl = fName;
i.ID = "I_1";
Panel1.Controls.Add(i);
private void SaveArrayToFile(uint [] ar, string FileName)
{
FileStream fs = new FileStream(FileName, FileMode.Create);
BinaryWriter w = new BinaryWriter(fs);
for (int i = 0; i < ar.Length; i++)
{
w.Write(ar);
}
w.Close();
fs.Close();
}
//=========================================
The problem is, that the pictures aren't shown, as the picures are garbage.
What is wrong ?
Best regards
Clas
i have a array of uint[] and want to display this array as a
System.Web.UI.WebControls.Image.
//=========================================
uint [] ar = new uint[3072];
string fName;
System.Web.UI.WebControls.Image i = new System.Web.UI.WebControls.Image();
vm.Display._GenerateThumbnail(ar);
fName = "c:\\temp\\f_" + vm.Name + ".bmp";
SaveArrayToFile(ar,fName);
i.ImageUrl = fName;
i.ID = "I_1";
Panel1.Controls.Add(i);
private void SaveArrayToFile(uint [] ar, string FileName)
{
FileStream fs = new FileStream(FileName, FileMode.Create);
BinaryWriter w = new BinaryWriter(fs);
for (int i = 0; i < ar.Length; i++)
{
w.Write(ar);
}
w.Close();
fs.Close();
}
//=========================================
The problem is, that the pictures aren't shown, as the picures are garbage.
What is wrong ?
Best regards
Clas