THUMBSIZE does not affect preview image size on acdbGetPreviewBitmapFromDwg()

THUMBSIZE does not affect preview image size on acdbGetPreviewBitmapFromDwg()

cdnbake
Enthusiast Enthusiast
1,158 Views
1 Reply
Message 1 of 2

THUMBSIZE does not affect preview image size on acdbGetPreviewBitmapFromDwg()

cdnbake
Enthusiast
Enthusiast

Good morning,

 

Today I was playing with the THUMBSIZE variable in AutoCAD Mechanical 2015 and 2017, and noticed that it does not affect the preview image size at all when using above OjectARX method.

 

I am reading the thumbnail of a DWG file and save it to a separate location as follows:

 

HRESULT hr = E_FAIL;

HBITMAP HBitmap;
HPALETTE HPalette;
bool succeeded = acdbGetPreviewBitmapFromDwg(strDocumentName, &HBitmap, &HPalette);

if (succeeded)
{
CBitmap bitmap;
bitmap.Attach(HBitmap);

CImage image;
image.Attach(bitmap);
hr = image.Save(strThumbnailFullFileName, Gdiplus::ImageFormatBMP);
}

DeleteObject(HBitmap);
DeleteObject(HPalette);

return hr;

 

It does not matter if I set the varriable THUMBSIZE to 0 or 1 or any value up to 8, the image saved to strThumbnailFullFileName has always:

  • 256 px width
  • 97 px height
  • 96 DPI
  • 25.3 KB file size

 

I have already read this thread: http://www.cadtutor.net/forum/showthread.php?82513-thumbnails-of-paper-space-sheets-are-too-small since the author noticed a similar problem in Windows Explorer but the issue has not been resolved yet.

 

Does anyone know how I can get a bigger preview image out of the DWG? 

 

Kind regards and have a nice day,
Bettina

Bettina Kutsche
CIDEON
take the value perspective.
1,159 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable

I know that this is really late, but I was playing with thumbsize today and saw your post.  There's a second variable called thumbsize2D .  thumbsize2D is set to 0 on default, which locks the thumbnail to a 256x256 size.  If you set it to 1, then thumbsize starts working again.

0 Likes