how to open .tif file in VC++ MFC
-
What's giving you trouble? The menu part? Opening a file? Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
What's giving you trouble? The menu part? Opening a file? Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
i am able to open the .tif file in OnDraw using libtiff library. But i want to open it from file open menu. it requires pDC to open. How to open from file open menu?
Opening the file has nothing to do with a DC or pDC. Are you trying to work with a TIFF file without a 3rd party library? If so, here's a couple options... 1) Use GDI+...
//
// this example doesn't include one-time GDI+ initialization
//
void CMyView::OnDraw(CDC *pDC)
{
Gdiplus::Bitmap bitmap(L"C:\\test.tif", FALSE);
Gdiplus::Graphics graphics(*pDC);
graphics.DrawImage(&bitmap, 0, 0, bitmap.GetWidth(), bitmap.GetHeight());
}- Study the TIFF specification[^] and write code to parse the TIFF file. Mark
Mark Salsbery Microsoft MVP - Visual C++ :java: