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. Compare two icons(.gif)

Compare two icons(.gif)

Scheduled Pinned Locked Moved C / C++ / MFC
c++json
18 Posts 7 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.
  • S SandipG

    You did not mention the magic site :D

    Regards, Sandip.

    C Offline
    C Offline
    CPallini
    wrote on last edited by
    #6

    Fixed. :-D

    If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
    This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
    [My articles]

    M 1 Reply Last reply
    0
    • C CPallini

      Fixed. :-D

      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
      This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
      [My articles]

      M Offline
      M Offline
      Michael Schubert
      wrote on last edited by
      #7

      You're so mean... Isn't the name of the function PlzComparezDaFilez(..) ?

      C 1 Reply Last reply
      0
      • M Michael Schubert

        You're so mean... Isn't the name of the function PlzComparezDaFilez(..) ?

        C Offline
        C Offline
        CPallini
        wrote on last edited by
        #8

        Michael Schubert wrote:

        PlzComparezDaFilez

        With the above name it is exported by the DLL only if you compile it defining the SMS_SLANGZ symbol. :)

        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
        This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
        [My articles]

        R 1 Reply Last reply
        0
        • C CPallini

          Hi Member 4708266, Are you by chance looking for a program to compare two .gif files using C++? [added] BTW There is the following function

          BOOL PleaseCompareTheseGifFiles(LPCTSTR szGifAFilename, LPCTSTR szGifBFilename);

          exported by the CompareStuff library available for free on www.freproductz.cpallini.com[^]. :-D [/added]

          If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
          This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
          [My articles]

          modified on Wednesday, October 15, 2008 11:30 AM

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

          CPallini wrote:

          available for free on www.freproductz.cpallini.com[^].

          And if you call in the next 10 minutes, we'll SUPERSIZE your order! That's right! You'll get TWO CompareStuff libraries FOR THE PRICE OF ONE! CALL NOW!!!!!

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

          1 Reply Last reply
          0
          • C CPallini

            Hi Member 4708266, Are you by chance looking for a program to compare two .gif files using C++? [added] BTW There is the following function

            BOOL PleaseCompareTheseGifFiles(LPCTSTR szGifAFilename, LPCTSTR szGifBFilename);

            exported by the CompareStuff library available for free on www.freproductz.cpallini.com[^]. :-D [/added]

            If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
            This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
            [My articles]

            modified on Wednesday, October 15, 2008 11:30 AM

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

            You are our winner because your site doesnt has any limited for generate code! :-D

            C 1 Reply Last reply
            0
            • H Hamid Taebi

              You are our winner because your site doesnt has any limited for generate code! :-D

              C Offline
              C Offline
              CPallini
              wrote on last edited by
              #11

              Don't forget that is ALL :rolleyes: free stuff! :laugh:

              If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
              This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
              [My articles]

              1 Reply Last reply
              0
              • M Michael Schubert

                Your request is rather vague. What do you want to compare, size of the files, content,...?

                S Offline
                S Offline
                Subrat 4708266
                wrote on last edited by
                #12

                I want to compare content of two .gif files using c++ win32 APIs. Size of two .gif files may be different, but if content is same, the our API should return true as they are same. Please reply me soon, it is very very URGENT.I have tried using LoadImage() and memcmp() APIs, but failed.If possible please give me the code. Thanks in Advance...

                H 1 Reply Last reply
                0
                • C CPallini

                  Michael Schubert wrote:

                  PlzComparezDaFilez

                  With the above name it is exported by the DLL only if you compile it defining the SMS_SLANGZ symbol. :)

                  If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                  This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                  [My articles]

                  R Offline
                  R Offline
                  Rajesh R Subramanian
                  wrote on last edited by
                  #13

                  :laugh:

                  Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche .·´¯`·->Rajesh<-·´¯`·. [Microsoft MVP - Visual C++]

                  1 Reply Last reply
                  0
                  • S Subrat 4708266

                    I want to compare content of two .gif files using c++ win32 APIs. Size of two .gif files may be different, but if content is same, the our API should return true as they are same. Please reply me soon, it is very very URGENT.I have tried using LoadImage() and memcmp() APIs, but failed.If possible please give me the code. Thanks in Advance...

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

                    You need to two loops for width and height and then you must be check pixels of two gif files of course this wasy is very slow.

                    S 1 Reply Last reply
                    0
                    • H Hamid Taebi

                      You need to two loops for width and height and then you must be check pixels of two gif files of course this wasy is very slow.

                      S Offline
                      S Offline
                      Subrat 4708266
                      wrote on last edited by
                      #15

                      I found the code as follow.But it isn't working fine.Please tell me the necessary modifications ASAP. int main() { HANDLE hBitMap = LoadImage(0, "img.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE); BITMAP bitmap; GetObject(hBitMap,sizeof(BITMAP),&bitmap); int size = bitmap.bmHeight*bitmap.bmWidth*bitmap.bmBitsPixel/8; BYTE *lpBits = new BYTE[ size ]; GetBitmapBits((HBITMAP)hBitMap,size,lpBits ); HANDLE hBitMap2 = LoadImage(0, "img2.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE); BITMAP bitmap2; GetObject(hBitMap2,sizeof(BITMAP),&bitmap2); int size2 = bitmap2.bmHeight*bitmap2.bmWidth*bitmap2.bmBitsPix el/8; BYTE *lpBits2 = new BYTE[ size2 ]; GetBitmapBits((HBITMAP)hBitMap2,size2,lpBits2 ); int ScreenWidth = bitmap2.bmWidth; int ScreenHeight = bitmap2.bmHeight; int numOfCard = 1;int x, j, k; int cardHeight = bitmap.bmHeight; int card_line_length = bitmap.bmWidth; for( i = 0 ; i < ScreenWidth; i++ ) { for( j = 0 ; j < ScreenHeight; j++ ) { for ( k= 0; k < numOfCard; k++ ) { int tmpY = j; for ( x = 0; x < cardHeight; x++ ) { if ( memcmp(lpBits2[i][tmpY],lpBits[x], card_line_length ) != 0 ) break; // we didnt find macth of a line tmpY++; // move to next line } if ( x == cardHeight) { cout << "found"; } } } } system("PAUSE"); return 0; }

                      H 1 Reply Last reply
                      0
                      • S Subrat 4708266

                        I found the code as follow.But it isn't working fine.Please tell me the necessary modifications ASAP. int main() { HANDLE hBitMap = LoadImage(0, "img.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE); BITMAP bitmap; GetObject(hBitMap,sizeof(BITMAP),&bitmap); int size = bitmap.bmHeight*bitmap.bmWidth*bitmap.bmBitsPixel/8; BYTE *lpBits = new BYTE[ size ]; GetBitmapBits((HBITMAP)hBitMap,size,lpBits ); HANDLE hBitMap2 = LoadImage(0, "img2.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE); BITMAP bitmap2; GetObject(hBitMap2,sizeof(BITMAP),&bitmap2); int size2 = bitmap2.bmHeight*bitmap2.bmWidth*bitmap2.bmBitsPix el/8; BYTE *lpBits2 = new BYTE[ size2 ]; GetBitmapBits((HBITMAP)hBitMap2,size2,lpBits2 ); int ScreenWidth = bitmap2.bmWidth; int ScreenHeight = bitmap2.bmHeight; int numOfCard = 1;int x, j, k; int cardHeight = bitmap.bmHeight; int card_line_length = bitmap.bmWidth; for( i = 0 ; i < ScreenWidth; i++ ) { for( j = 0 ; j < ScreenHeight; j++ ) { for ( k= 0; k < numOfCard; k++ ) { int tmpY = j; for ( x = 0; x < cardHeight; x++ ) { if ( memcmp(lpBits2[i][tmpY],lpBits[x], card_line_length ) != 0 ) break; // we didnt find macth of a line tmpY++; // move to next line } if ( x == cardHeight) { cout << "found"; } } } } system("PAUSE"); return 0; }

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

                        I dont have any compiler for text your code but you can use of a simple code instead this code but its very slow.You can use COLORREF CImage::GetPixel(int x,int y) it returns RGB of pixels on the loop you can use of it for first gif and second gif for check COLORREF.

                        S 1 Reply Last reply
                        0
                        • H Hamid Taebi

                          I dont have any compiler for text your code but you can use of a simple code instead this code but its very slow.You can use COLORREF CImage::GetPixel(int x,int y) it returns RGB of pixels on the loop you can use of it for first gif and second gif for check COLORREF.

                          S Offline
                          S Offline
                          Subrat 4708266
                          wrote on last edited by
                          #17

                          Hi Hamid, Thanks for your reply.But I failed to get it. In your free time plz send me the code.I think no of lines will be limited to max 10.So won't take more time. Thanks & Regards.

                          H 1 Reply Last reply
                          0
                          • S Subrat 4708266

                            Hi Hamid, Thanks for your reply.But I failed to get it. In your free time plz send me the code.I think no of lines will be limited to max 10.So won't take more time. Thanks & Regards.

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

                            But why you dont use of Codeproject's articles they used of fast way because dont know I saw them on the codeproject or codeguru its better you see here and there.

                            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