Back to Devexpress

WinExplorerView.GetThumbnailImage Event

windowsforms-devexpress-dot-xtragrid-dot-views-dot-winexplorer-dot-winexplorerview-cb5b7b19.md

latest6.3 KB
Original Source

WinExplorerView.GetThumbnailImage Event

Allows you to asynchronously assign an image to a WinExplorerView record.

Namespace : DevExpress.XtraGrid.Views.WinExplorer

Assembly : DevExpress.XtraGrid.v25.2.dll

NuGet Packages : DevExpress.Win.Grid, DevExpress.Win.Navigation

Declaration

csharp
[DXCategory("Data")]
public event ThumbnailImageEventHandler GetThumbnailImage
vb
<DXCategory("Data")>
Public Event GetThumbnailImage As ThumbnailImageEventHandler

Event Data

The GetThumbnailImage event's data class is ThumbnailImageEventArgs. The following properties provide information specific to this event:

PropertyDescription
DataSourceIndexGets the index of the currently processed item among other items in the source (the item’s index in the bound data source for data-aware controls, e.g., GridControl).
DesiredThumbnailSizeStores the desired size of thumbnail images, generated using the ThumbnailImageEventArgs.CreateThumbnailImage method.
ThumbnailImageGets or sets the image that will be assigned to an item that fired this event.

The event data class exposes the following methods:

MethodDescription
CreateThumbnailImage(Image, Size)Creates a thumbnail image of the specific size. This image will be later assigned to an item that supports the asynchronous image load feature.
CreateThumbnailImage(Image)Creates a thumbnail image that will be assigned to an item that supports the asynchronous image load feature.
ResetImageCache()Resets the image cache and causes all items that are not currently visible to reload their images when displayed again.

Remarks

The GetThumbnailImage event is raised each time a WinExplorerView record needs to display its image and both of the following conditions are met:

The event allows you to create a required image by using the ThumbnailImageEventArgs.CreateThumbnailImage method and assign the generated image to the ThumbnailImageEventArgs.ThumbnailImage property. See the Asynchronous Image Load in Data Grid topic to learn more.

Important

The GetThumbnailImage event is raised from a non-UI thread.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the GetThumbnailImage event.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

office-file-api-create-thumbnail-images-for-docx-xlsx-pdf-files/CS/Form1.cs#L24

csharp
InitViewSettings();
    winExplorerView1.GetThumbnailImage += WinExplorerView_GetThumbnailImage;
}

office-file-api-create-thumbnail-images-for-docx-xlsx-pdf-files/VB/Form1.vb#L21

vb
InitViewSettings()
    AddHandler winExplorerView1.GetThumbnailImage, AddressOf WinExplorerView_GetThumbnailImage
End Sub

See Also

AsyncLoad

LoadThumbnailImagesFromDataSource

CreateThumbnailImage

ThumbnailImage

Asynchronous Image Load in Data Grid

WinExplorerView Class

WinExplorerView Members

DevExpress.XtraGrid.Views.WinExplorer Namespace