Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Blob image memory stream
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Blob image memory stream
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01101899
Message ID:
01101899
Vues:
68
Hey all, I'm working with a VFP app and I'm trying to display an image from an image field in sql server 2000. I'm trying to do the same thing I'm doing in a c# app. This is the code in c#. Basically I dont want to create the file, I know I can do that in VFP but I'd rather stream from memory. If anyone has had any experience with this some help would be great.

In c#:

FileStream fs = new FileStream(textBox8.Text.Trim(), FileMode.Open);
byte[] image = new Byte[fs.Length];

fs.Read(image, 0, Convert.ToInt32(fs.Length.ToString(), 10) - 1);
fs.Close();
ApplyImage(image);

private void ApplyImage(byte[] image)
{
MemoryStream imageStream = new MemoryStream(image);
pictureBox1.Image = Image.FromStream(imageStream);
}
Répondre
Fil
Voir

Click here to load this message in the networking platform