VintaSoft Imaging .NET SDK and Plug-ins Discussions

Questions, comments and suggestions concerning VintaSoft Imaging .NET SDK.

Board index < VintaSoft Imaging < VintaSoft Imaging .NET SDK and Plug-ins Discussions

We are migrating to new forums engine, no new registration or posting currently available. TIA for your patience.

Retrieving an image from the database



Retrieving an image from the database

Post by BillG »

I am trying to retrieve my image from the database.

here is what I have so far.
// retrieves the row in the MemberPhoto table as an object
memberPhoto = Repository.GetMemberPhoto(currentMember.SocSecNo);
if (memberPhoto != null)                          // verifies the valid row was retrieved
{
    byte[] data = memberPhoto.Photo;       // retrieves the image from the field in the object and assigns it to a byte Array

    image = VintasoftImage.FromStream(new MemoryStream(data));
                
    DisplayPhoto(image);
}
Now how do I take it from the bytearray to a vintasoft image ready to be displayed?


Re: Retrieving an image from the database

Post by BillG »

figured it out.


Re: Retrieving an image from the database

Post by Alex »

Hi Bill,
Now how do I take it from the bytearray to a vintasoft image ready to be displayed? You need retrieve data as byte array from database, add byte array to a MemoryStream and create instance of VintasoftImage class based on memory stream.

Best regards, Alexander


Page 1 from 1: 1