Picture not displayed in Smart Client

I have an Access plugin connected to our Access Control.

Picture is uploaded well because I have a small test program where I can see the picture.

I don’t need a cache because all is already done on the server.

I can’t see anything on the Smart Client/

Here is my source code:

var relatedCredentialHolderIds = new List();

List credentialHolders = new List();

List properties = new List();

properties.Add(new ACProperty(“Card Id”, deviceAlarmRT.IdentifierNumber + " " + HolderName));

properties.Add(new ACProperty(“Expiry date”, enddate.ToLongDateString()));

var credentialHolderId = Guid.NewGuid();

ACCredentialHolder credentialHolder = new ACCredentialHolder(credentialHolderId.ToString(), HolderName, new string[] { }, photoPerson, properties);

eventType = AcccessPointEventId.GrantedCredential;

eventMessage = AcccessPointEventId.GrantedCredential.ToString();

relatedCredentialHolderIds.Add(credentialHolder.Id);

credentialHolders.Add(credentialHolder);

ACEvent acEvent = new ACEvent(Guid.NewGuid().ToString(), eventType, APsourceId.ToString(),

         DateTime.UtcNow, eventMessage, reason, relatedCredentialHolderIds, null, null);

EventTriggered(this, new EventTriggeredEventArgs(acEvent));

Thank you for your help.

Isabelle JOUBERT

Please update. I believe you solved this but there was an additional question?

Here is the code updated, the good way to use an Image is:

byte[] imgBytes = person.Photo;

if (imgBytes != null && imgBytes.Length > 0)

{

       **photoPerson = (Bitmap)((new ImageConverter()).ConvertFrom(imgBytes));**

}

If you get picture as an array of byte, you should not use a stream as below:

using (MemoryStream ImageStream = new System.IO.MemoryStream(imgBytes))

{

photoPerson = Image.FromStream(ImageStream);

}

Because stream must be opened during the life of the Image instance and it wasn’t the case here.

Thank you for sharing your experience.

Do you have questions, concerns or suggestions to Milestone Development based on your experience working with this?