Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Displaying general vfp field in c#
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01321933
Message ID:
01321968
Vues:
17
>>>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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform