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. reg., CImage sources (UNICODE COMPATIBLE) to load GIF, JPEG

reg., CImage sources (UNICODE COMPATIBLE) to load GIF, JPEG

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
5 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.
  • G Offline
    G Offline
    ganesa moorthy
    wrote on last edited by
    #1

    Where we can get CImage sources (UNICODE COMPATIBLE) to load GIF, JPEG in our application ? :confused: Anyone Please help on this. Thanks a Lot:rose:

    Thanks a lot

    M H 2 Replies Last reply
    0
    • G ganesa moorthy

      Where we can get CImage sources (UNICODE COMPATIBLE) to load GIF, JPEG in our application ? :confused: Anyone Please help on this. Thanks a Lot:rose:

      Thanks a lot

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

      The source code is included with Visual Studio. CImage uses GDI+ to load and save images.  The loaded GDI+ image is converted to a DIBsection, which is wrapped by the CImage class. The loading code is similar to this (without the conversion to a DIBSection):

      ULONG dwToken;
          Gdiplus::GdiplusStartupInput input;
          Gdiplus::GdiplusStartupOutput output;
          Gdiplus::Status status = Gdiplus::GdiplusStartup(&dwToken, &input, &output);
          if(status == Gdiplus::Ok)
          {
              Gdiplus::Bitmap *pSrcBitmap = new Gdiplus::Bitmap(L"C:\\test.jpg", FALSE);

      //... use the bitmap ...

      delete pSrcBitmap;

      Gdiplus::GdiplusShutdown(dwToken);
          }

      Mark

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

      G 1 Reply Last reply
      0
      • M Mark Salsbery

        The source code is included with Visual Studio. CImage uses GDI+ to load and save images.  The loaded GDI+ image is converted to a DIBsection, which is wrapped by the CImage class. The loading code is similar to this (without the conversion to a DIBSection):

        ULONG dwToken;
            Gdiplus::GdiplusStartupInput input;
            Gdiplus::GdiplusStartupOutput output;
            Gdiplus::Status status = Gdiplus::GdiplusStartup(&dwToken, &input, &output);
            if(status == Gdiplus::Ok)
            {
                Gdiplus::Bitmap *pSrcBitmap = new Gdiplus::Bitmap(L"C:\\test.jpg", FALSE);

        //... use the bitmap ...

        delete pSrcBitmap;

        Gdiplus::GdiplusShutdown(dwToken);
            }

        Mark

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

        G Offline
        G Offline
        ganesa moorthy
        wrote on last edited by
        #3

        Actually i am sure, there is no manual for CImage, in MS Visual Studio though it is included. If so what header i need to include to proceed? Thanks for your response! :rose:

        Thanks a lot

        M 1 Reply Last reply
        0
        • G ganesa moorthy

          Actually i am sure, there is no manual for CImage, in MS Visual Studio though it is included. If so what header i need to include to proceed? Thanks for your response! :rose:

          Thanks a lot

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

          atlimage.h in VS 2008 - most of it is inline. It used to be an MFC class so it was a different header file before.  What version of Visual Studio are you using? If you don't have a VS version that has the class, you can always use GDI+ directly, as I showed in the sample code. Mark

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

          1 Reply Last reply
          0
          • G ganesa moorthy

            Where we can get CImage sources (UNICODE COMPATIBLE) to load GIF, JPEG in our application ? :confused: Anyone Please help on this. Thanks a Lot:rose:

            Thanks a lot

            H Offline
            H Offline
            Hamid Taebi
            wrote on last edited by
            #5

            you can find it on the its header file.

            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