# Použití miniaturních obrazových dat

Existuje možnost zapsat obrazová data pro exportovanou entitu Vault do DI - EcENTITY.thumbnail. Chcete-li obrázek uložit na disk, nahrajte hodnotu sql jako pole bajtů a tato data zapište jako soubor jpg.

Chcete-li získat objekt .NET FRAMEWORK System.Drawing.Image, můžete použít tuto ukázku:

<pre class="language-sql"><code class="lang-sql">/// &#x3C;summary>
/// http://justonesandzeros.typepad.com/blog/2011/05/viewing-thumbnails.html
/// &#x3C;/summary>
/// &#x3C;param name="propVal">the value of the property Thumbnail&#x3C;/param>
/// &#x3C;param name="width">image width&#x3C;/param>
/// &#x3C;param name="height">image height&#x3C;/param>
/// &#x3C;returns>&#x3C;/returns>
public static System.Drawing.Image GetThumbnail(object propVal, int width, int height)
{
<strong>    if (propVal == null || false == (propVal is byte[]))
</strong>        return null;
    byte[] thumbnailRaw = (byte[])propVal;
    System.Drawing.Image retVal = null;
    using (System.IO.MemoryStream ms = new System.IO.MemoryStream(thumbnailRaw))
    {
        try
        {
<strong>            ms.Seek(12, System.IO.SeekOrigin.Begin);
</strong>            System.Drawing.Imaging.Metafile metafile =
                    new System.Drawing.Imaging.Metafile(ms);
<strong>            retVal = metafile.GetThumbnailImage(width, height,
</strong>                    new System.Drawing.Image.GetThumbnailImageAbort(GetThumbnailImageAbort),
                    System.IntPtr.Zero);
        }
<strong>        catch
</strong>        {
            retVal = null;
<strong>        }
</strong><strong>        
</strong>        if (retVal == null)
        {
            try
            {
                ms.Seek(0, System.IO.SeekOrigin.Begin);
                System.Drawing.Image rawImage = System.Drawing.Image.FromStream(ms, true);
                retVal = rawImage.GetThumbnailImage(width, height,
<strong>                    new System.Drawing.Image.GetThumbnailImageAbort(GetThumbnailImageAbort),
</strong>                    System.IntPtr.Zero);
            }
            catch
<strong>            {
</strong>                retVal = null;
<strong>            }
</strong>        }
    }
    return retVal;
}
</code></pre>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.besmart.software/erpc/cz-erp-connector/datove-rozhrani-referencni-manual/pouziti-miniaturnich-obrazovych-dat.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
