GdPicture.NET Reference Guide
HasAttachedThumbnail Method (GdPictureImaging)
Example 





GdPicture14 Namespace > GdPictureImaging Class : HasAttachedThumbnail Method
GdPicture Image Identifier.
Some images embed a thumbnail bitmap for previewing purpose. This method helps to determine if a specific GdPicture image has one.
Syntax
'Declaration
 
Public Function HasAttachedThumbnail( _
   ByVal ImageID As Integer _
) As Boolean
public bool HasAttachedThumbnail( 
   int ImageID
)
public function HasAttachedThumbnail( 
    ImageID: Integer
): Boolean; 
public function HasAttachedThumbnail( 
   ImageID : int
) : boolean;
public: bool HasAttachedThumbnail( 
   int ImageID
) 
public:
bool HasAttachedThumbnail( 
   int ImageID
) 

Parameters

ImageID
GdPicture Image Identifier.

Return Value

True if a thumbnail bitmap is attached to the image, False otherwise.
Remarks
Use the GetStat() method to check if this method has completed successfully.
Example
Dealing with attached thumbnails.
Dim oGdPictureImaging As New GdPictureImaging
Dim ImageID As Integer = oGdPictureImaging.CreateGdPictureImageFromFile("myphoto.jpg")
'Detach existing thumbnail, if any.
oGdPictureImaging.DetachThumbnail(ImageID)
'Generates a HQ thumbnail.
Dim ThumbnailImageID As Integer = oGdPictureImaging.CreateThumbnailHQ(ImageID, CInt(oGdPictureImaging.GetWidth(ImageID) / 10), CInt(oGdPictureImaging.GetHeight(ImageID) / 10))
'Attach the generated thumbnail to the bitmap.
oGdPictureImaging.AttachThumbnail(ImageID, ThumbnailImageID)
'Releasing GdPicture thumbnail bitmap.
oGdPictureImaging.ReleaseGdPictureImage(ThumbnailImageID)
'Saving image to jpeg format.
oGdPictureImaging.SaveAsJPEG(ImageID, "imagewiththumbnail.jpg")
'Releasing input image.
oGdPictureImaging.ReleaseGdPictureImage(ImageID)
'Now extracting the thumbnail from the created bitmap.
ImageID = oGdPictureImaging.CreateGdPictureImageFromFile("imagewiththumbnail.jpg")
ThumbnailImageID = oGdPictureImaging.GetAttachedThumbnail(ImageID)
'Saving thumbnail as PNG
oGdPictureImaging.SaveAsPNG(ThumbnailImageID, "thumbnail.png")
'Releasing images from the memory
oGdPictureImaging.ReleaseGdPictureImage(ImageID)
oGdPictureImaging.ReleaseGdPictureImage(ThumbnailImageID)
'We're done with the oGdPictureImaging object.
oGdPictureImaging.Dispose()
See Also

Reference

GdPictureImaging Class
GdPictureImaging Members
GetAttachedThumbnail Method