PSD, спокойно, ща насоветуем
Если есть возможность - используй gdi+ - поддерживает многие форматы:
void CImagePreviewWnd::OnPaint()
{
CPaintDC dc(this);
CDC *pDC = &dc;
// Fill the preview area with a WHITE background.
RECT rect;
GetClientRect(&rect);
rect.left += 1;
rect.top += 1;
rect.right -= 1;
rect.bottom -= 1;
pDC->FillSolidRect(&rect, RGB(255,255,255));
if(m_stImgFile.IsEmpty()) return;
USES_CONVERSION;
UINT uiWidth, uiHeight;
int iAdjTop , iAdjLeft;
double dRatio;
iAdjTop = 1;
iAdjLeft = 1;
// Initialize the Graphics class in GDI+.
Graphics graphics(pDC->m_hDC);
// Use the Image class to display a thumbnail of the image.
Image image(T2CW(m_stImgFile));
if(image.GetLastStatus()!=Ok) return;
// Determine the appropriate size of the thumbnail preview
// given the image size ratio and the preview window size ratio.
uiWidth = image.GetWidth();
uiHeight = image.GetHeight();
dRatio = ((double)uiWidth)/((double)uiHeight);
// If the width is larger than the height of the image,
// set the width of the thumbnail to the width of the preview area
// and calculate the thumbnail height by using the ratios.
// If the height is larger than the width of the image,
// set the height of the thumbnail to the height of the preview area
// and calculate the thumbnail width by using the ratios.
if(m_bThumb)
{
UINT thumbWidth, thumbHeight;
if (uiWidth > uiHeight)
{
thumbWidth = rect.right - rect.left;
thumbHeight = (UINT)(thumbWidth/dRatio);
if (thumbHeight == 0) thumbHeight = 1;
if (thumbHeight > (UINT)(rect.bottom - rect.top)) thumbHeight = rect.bottom - rect.top;
// Adjust things to make the preview not paint over the control border.
iAdjTop = 1 + ((rect.bottom - rect.top)/2) - (thumbHeight/2);
iAdjLeft = 1;
}
else
{
thumbHeight = rect.bottom - rect.top;
thumbWidth = (UINT)(uiWidth*thumbHeight/uiHeight);
if (thumbWidth == 0) thumbWidth = 1;
if (thumbWidth > (UINT)(rect.right - rect.left)) thumbWidth = rect.right - rect.left;
// Adjust things to make the preview not paint over the control border.
iAdjTop = 1;
iAdjLeft = 1 + ((rect.right - rect.left)/2) - (thumbWidth/2);
}
// Get the thumbnail and display it in the preview control.
Image* pThumbnail = image.GetThumbnailImage(thumbWidth, thumbHeight, NULL, NULL);
graphics.DrawImage(pThumbnail, iAdjLeft, iAdjTop, pThumbnail->GetWidth(), pThumbnail->GetHeight());
delete pThumbnail;
}
else
{
graphics.DrawImage(&image, iAdjLeft, iAdjTop, uiWidth, uiHeight);
}
}