Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. how to open .tif file in VC++ MFC

how to open .tif file in VC++ MFC

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorialquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vandana7
    wrote on last edited by
    #1

    how to open .tif file in VC++ MFC from file menu?

    M 1 Reply Last reply
    0
    • V vandana7

      how to open .tif file in VC++ MFC from file menu?

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      What's giving you trouble?  The menu part?  Opening a file? Mark

      Mark Salsbery Microsoft MVP - Visual C++ :java:

      V 1 Reply Last reply
      0
      • M Mark Salsbery

        What's giving you trouble?  The menu part?  Opening a file? Mark

        Mark Salsbery Microsoft MVP - Visual C++ :java:

        V Offline
        V Offline
        vandana7
        wrote on last edited by
        #3

        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?

        M 1 Reply Last reply
        0
        • V vandana7

          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?

          M Offline
          M Offline
          Mark Salsbery
          wrote on last edited by
          #4

          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());
          }

          1. Study the TIFF specification[^] and write code to parse the TIFF file. Mark

          Mark Salsbery Microsoft MVP - Visual C++ :java:

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups