Quantcast
Channel: Forums - ArcObjects SDKs
Viewing all articles
Browse latest Browse all 1374

IDocumentPreview.CreatePreview no longer works in ArcMap 10.1?

$
0
0
Since upgrading to ArcMap 10.1 (SP1), the methods IDocumentPreview.CreatePreview and IDocumentPreview.DeletePreview no longer seem to work. Below is a bit of code that worked in ArcMap 10.0, but does not work in ArcMap 10.1.

C#
Code:

public static void CreateThumbnailForCurrentDoc(IApplication application)
{   
    IDocumentPreview preview = (IDocumentPreview)application.Document;   
    preview.CreatePreview();   
    application.SaveDocument();
}

It's worth mentioning that this interface was also buggy in ArcMap 10.0. After calling CreatePreview, the preview would not be persisted with the MXD unless it already had a thumbnail image created using the Map Document Properties dialog's "Make Thumbnail" button. So it functioned more like an UpdatePreview method rather than a CreatePreview method. Still, it worked well enough to meet my need.

In ArcMap 10.1 CreatePreview and DeletePreview will update the status of the HasPreviewToSave property, but I cannot create, update, or delete a thumbnail.

Does anyone have a working method of saving a thumbnail of the map in an MXD document? It is very frustrating since I know this can be done since the "Make Thumbnail" and "Delete Thumbnail" buttons in the Map Document Properties dialog work.

Viewing all articles
Browse latest Browse all 1374

Trending Articles