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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. loading tiff, bmp and DIB file in MDI application

loading tiff, bmp and DIB file in MDI application

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++questionlearning
6 Posts 3 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.
  • U Offline
    U Offline
    User 545719
    wrote on last edited by
    #1

    Hi, I am developing an MDI application to load .bmp,.tiff and DIB files. For bmp the program works fine but for tiff it displays "error in opening DIB file". What I've found so far in the web is a program which display only tiff file. Anyone can help me? Quite urgent... deadline approaching :sigh: and I am real beginner in MFC... thx in advance crinoidea

    L B 2 Replies Last reply
    0
    • U User 545719

      Hi, I am developing an MDI application to load .bmp,.tiff and DIB files. For bmp the program works fine but for tiff it displays "error in opening DIB file". What I've found so far in the web is a program which display only tiff file. Anyone can help me? Quite urgent... deadline approaching :sigh: and I am real beginner in MFC... thx in advance crinoidea

      L Offline
      L Offline
      l a u r e n
      wrote on last edited by
      #2

      u would need to understand the tiff file format and convert after opening images ... there are a bunch of libs here on cp that will do that for u if u look :)


      "there is no spoon"
      biz stuff   about me

      U 1 Reply Last reply
      0
      • L l a u r e n

        u would need to understand the tiff file format and convert after opening images ... there are a bunch of libs here on cp that will do that for u if u look :)


        "there is no spoon"
        biz stuff   about me

        U Offline
        U Offline
        User 545719
        wrote on last edited by
        #3

        You mean using .lib files? Can I do without the .lib files so that I have a stand alone .exe application?

        L 1 Reply Last reply
        0
        • U User 545719

          You mean using .lib files? Can I do without the .lib files so that I have a stand alone .exe application?

          L Offline
          L Offline
          l a u r e n
          wrote on last edited by
          #4

          errrrr check them out im sure theres something that will do what u want


          "there is no spoon"
          biz stuff   about me

          1 Reply Last reply
          0
          • U User 545719

            Hi, I am developing an MDI application to load .bmp,.tiff and DIB files. For bmp the program works fine but for tiff it displays "error in opening DIB file". What I've found so far in the web is a program which display only tiff file. Anyone can help me? Quite urgent... deadline approaching :sigh: and I am real beginner in MFC... thx in advance crinoidea

            B Offline
            B Offline
            Babayan Hovhannes
            wrote on last edited by
            #5

            I have downloaded Microsoft SDK. This SDK contains "*.lib" and "*.h" files for GDI+ graphic library. With this library you can load tiff, jpeg, gif, bmp formats with three lines of code. For example: //for opening image... Image *pImage; pImage=Image::FromFile(L"myimage.tiff"); //for drawing on pDC... CRect rect; GetClientRect(&rect); Graphics *pGraphics=Graphics::FromHDC(pDC->GetSafeHdc()); UINT width = m_pImage->GetWidth(); UINT height= m_pImage->GetHeight(); Rect destinationRect(0, 0, rect.Width(), rect.Height()); // Scale the image so that it fills the destination rectangle. pGraphics->DrawImage(m_pImage,destinationRect, 0, 0, width, height, UnitPixel); yiy

            U 1 Reply Last reply
            0
            • B Babayan Hovhannes

              I have downloaded Microsoft SDK. This SDK contains "*.lib" and "*.h" files for GDI+ graphic library. With this library you can load tiff, jpeg, gif, bmp formats with three lines of code. For example: //for opening image... Image *pImage; pImage=Image::FromFile(L"myimage.tiff"); //for drawing on pDC... CRect rect; GetClientRect(&rect); Graphics *pGraphics=Graphics::FromHDC(pDC->GetSafeHdc()); UINT width = m_pImage->GetWidth(); UINT height= m_pImage->GetHeight(); Rect destinationRect(0, 0, rect.Width(), rect.Height()); // Scale the image so that it fills the destination rectangle. pGraphics->DrawImage(m_pImage,destinationRect, 0, 0, width, height, UnitPixel); yiy

              U Offline
              U Offline
              User 545719
              wrote on last edited by
              #6

              Thanks for the code, but actually I am starting from DIBlook from MFC sample: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcsample98/html/\_sample\_mfc\_diblook.asp Is it possible to modify this program so that it can display .tiff image as well? I have found a .cpp file which can convert .tiff to DIB, but not sure how to integrate it.

              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