public void GetImage(Ctx ctx, int ad_image_id, int size) { MImage mimg = new MImage(ctx, ad_image_id, null); var value = mimg.GetThumbnailByte(size, size); if (value != null) { UsrImage = Convert.ToBase64String(value); //obj.UsrImage = Convert.ToBase64String(mimg.GetBinaryData()); if (mimg.GetBinaryData() != null) { Isdatabase = true; } } }