This document is archived and information here might be outdated. Recommended version. |
ArcObjects namespaces > Controls > ESRI ArcGIS Controls > Interfaces > IS > ISymbologyStyleClass Interface > ISymbologyStyleClass.PreviewItem Method (ArcObjects .NET 10.4 SDK) |
Previews the specified item as a bitmap.
[Visual Basic .NET] Public Function PreviewItem ( _ ByVal item As IStyleGalleryItem, _ ByVal Width As Integer, _ ByVal Height As Integer _ ) As stdole.IPictureDisp
[C#] public stdole.IPictureDisp PreviewItem ( IStyleGalleryItem item, int Width, int Height );
[C++]
HRESULT PreviewItem(
IStyleGalleryItem* item,
long Width,
long Height,
Picture** Bitmap
);
[C++]
Parameters item [in]
item is a parameter of type IStyleGalleryItem Width [in] Width is a parameter of type long Height [in] Height is a parameter of type long Bitmap [out, retval]
Bitmap is a parameter of type Picture
Returns a picture implementing IPictureDisp of the specified item. Use the method to display a preview of the item in another control, such as a PictureBox.
1078 800a0436: The specified item is not recognized as a valid symbology
//Get the style class
ISymbologyStyleClass symbologyStyleClass=axSymbologyControl1.GetStyleClass(axSymbologyControl1.StyleClass);//Preview an image of the symbol
stdole.IPictureDisp picture=symbologyStyleClass.PreviewItem(m_styleGalleryItem, pictureBox1.Width, pictureBox1.Height); System.Drawing.Image image=System.Drawing.Image.FromHbitmap(new
System.IntPtr(picture.Handle)); pictureBox1.Image=image;
'Get the style class
Dim
symbologyStyleClassAs
ISymbologyStyleClass symbologyStyleClass=AxSymbologyControl1.GetStyleClass(AxSymbologyControl1.StyleClass)'Preview an image of the symbol
Dim
pictureAs
stdole.IPictureDisp picture=SymbologyStyleClass.PreviewItem(m_styleGalleryItem, PictureBox1.Width, PictureBox1.Height)Dim
imageAs
System.Drawing.Image image=System.Drawing.Image.FromHbitmap(New
System.IntPtr(picture.Handle)) PictureBox1.Image=image