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:
01321968
Views:
16
>>>Hi all, i'm doing a form that must display company logo, and this logo is stored in a vfp table like general field, is it possible to get this logo and show it in a picture control in c# ?
>>>T.I.A.
>
>>You should be able to cast it to a byte array (byte[]) and them instantiate >a Bitmap with the byte array. The bitmap can be used in a picture control.
>
>Hi Einar, could you please tell me how?
>i have this:
>Tables.Tables["company"].Rows[0]["Image"] --> {Dimensions:[36667]} Type object {byte[]}
>
>i have the picture control in the form, how can i do that?
>thanks,

This should compile but I don't know if it will work.
byte[] ba = (byte[])Tables.Tables["company"].Rows[0]["Image"];
MemoryStream stream = new MemoryStream(ba);
this.pictureBox1.Image = new Bitmap(stream);
or
this.pictureBox1.Image = new Bitmap(new MemoryStream((byte[])Tables.Tables["company"].Rows[0]["Image"]));
Semper ubi sub ubi.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform