FreeImage 를 사용하고 있습니다. 좋은 라이브러리의 사용으로 인해 다양한 그래픽 파일들을 불러올 수 있습니다. 이미지의 확대, 축소시에 약간 느린것이 단점이지만 2장의 이미지를 한번에 보는 기능을 제외하고는 원하는 거의 대부분의 기능을 가지고 있습니다.
fipImage image;
if ( FALSE == image.load("c:\\a.jpg") )
{
cout << "can't load" << endl;
return;
}
fipTag tag;
fipMetadataFind finder;
if( finder.findFirstMetadata(FIMD_EXIF_MAIN, image, tag) )
{
do
{
// process the tag
cout << "Key : " << tag.getKey() << "\n";
cout << "toString : " << tag.toString(FIMD_EXIF_MAIN) << endl;
} while( finder.findNextMetadata(tag) );
}
// the class can be called again with another metadata model
if( finder.findFirstMetadata(FIMD_EXIF_EXIF, image, tag) )
{
do
{
// process the tag
cout << "Key : " << tag.getKey() << "\n";
cout << "toString : " << tag.toString(FIMD_EXIF_MAIN) << endl;
}
while( finder.findNextMetadata(tag) );
}
FIBITMAP * pBitmap = GenericLoader("a.pns", 0);
CDC * pDC = this->GetDC();
//int r = SetStretchBltMode(pDC, 3 /* COLORONCOLOR */);
int r = StretchDIBits(*pDC,
0, 0, 300, 300,
0, 0, (int)FreeImage_GetWidth(pBitmap), (int)FreeImage_GetHeight(pBitmap),
FreeImage_GetBits(pBitmap),
FreeImage_GetInfo(pBitmap),
0 /* DIB_RGB_COLORS */, 0x00CC0020 /* SRCCOPY */);
if ( r == GDI_ERROR )
{
MessageBox("Can't draw");
}
text file 에 연결할 경우 다음과 같이 한다. .bmp 파일에 연결할 경우 아래의 txtfile 을 .bmp 로 고친다.
HKCR
{
NoRemove txtfile
{
NoRemove ShellEx
{
NoRemove ContextMenuHandlers
{
ForceRemove SimpleShlExt = s `'{5E2121EE-0300-11D4-8D3B-444553540000}'`
}
}
}
}