Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Displaying general vfp field in c#
Message
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01321933
Message ID:
01322079
Views:
17
>>If you change the code to this
>>
>>byte[] ba = (byte[])Tables.Tables["company"].Rows[0]["Image"];
>>MemoryStream stream = new MemoryStream(ba);
>>Bitmap bitmap = new Bitmap(stream);
>>this.pictureBox1.Image = bitmap;
>>
>>does it throw an exception on this line "Bitmap bitmap = new Bitmap(stream);"? --> YES its generating "Parameter is not valid"
>
>
>Try this (this time I tried to run the code)
>
>byte[] ba = (byte[])Tables.Tables["company"].Rows[0]["Image"];
>MemoryStream stream = new MemoryStream(ba);
>stream.Write(ba, 0, ba.Length);
>Bitmap bitmap = (Bitmap)Bitmap.FromStream(stream, true);
>this.pictureBox1.Image = bitmap;
>
Should it be possible to shorten this by using Image.FromStream(stream) ?
Regards,
Viv
Previous
Reply
Map
View

Click here to load this message in the networking platform