Ich versuche Abbildung in List Und Label in eine Liste da zu geben.
Die Abbildung (Bitmap/Jpeg) komt aus einer Datenbank, und ist als Base64Encoded gespeichert.
Es gibt keine Datei die iregenwo abgelegt ist.
Ich habe versucht mit fieldtype LL_DRAWING und LL_DRAWING_HBITMAP.
Im designer wirdt angezeigt das es abbilding betrifft, aber die abbildung ist unsichtbar.
Dann habe ich ein Bericht zu Combit geschickt, incl. log Dateien von dem Designer un den Ausdruck.
Da kam die Antwort.....
Code: Alles auswählen
Dear Jack,
Thank you for your patience.
After analysis of your files by our development department, I would like to pass on the following findings to you:
Unfortunately, the conversion will not work for XBase++. Unfortunately, you will have to create a corresponding conversion yourself.
The corresponding .NET code would then look like this:
========================================================================================================================
/// <summary>
/// Tries to convert the passed string to an image using Base64 decoding
/// </summary>
/// <param name="content">The string to convert</param>
/// <returns>Resulting image or null if the string could not be decoded.</returns>
protected Image GetImageFromBase64(string content)
{
// Some speedy sanity check. As content is either a path or a valid Base64 image, we check for \ as shortcut as well.
if(content == null || content.Length == 0 || content.Length % 4 != 0
|| content.Contains("\\"))
return null;
byte[] bytes = null;
try
{
bytes = Convert.FromBase64String(content);
Image image;
MemoryStream ms = new MemoryStream(bytes);
image = Image.FromStream(ms);
// do _not_ dispose the stream for Bitmaps, see https://stackoverflow.com/questions/336387/image-save-throws-a-gdi-exception-because-the-memory-stream-is-closed
if (!(image is Bitmap))
{
ms.Dispose();
}
return image;
}
catch (Exception ex)
{
// a FormatException would be expected for invalid Base64 strings
if (!(ex is FormatException))
{
LoggingHelper.LogExceptionDetails(ex);
}
return null;
}
}
========================================================================================================================
You would have to implement such a function in Xbase++, and then pass the handle to the image (or a temporary path).
If you have any further questions left, please don't hesitate to ask.
Ist da jemand in diesen Forum der behilflich sein kan mit das übersetzen von diesen code zu Xbase++
M.fr.gr,
Jack Duijf