Click here to Skip to main content
16,005,121 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Compare two bitmap Pin
jeremysay14-Feb-03 2:12
jeremysay14-Feb-03 2:12 
GeneralRe: Compare two bitmap Pin
MAAK14-Feb-03 2:41
MAAK14-Feb-03 2:41 
GeneralRe: Compare two bitmap Pin
jeremysay14-Feb-03 3:18
jeremysay14-Feb-03 3:18 
GeneralRe: Compare two bitmap Pin
jeremysay14-Feb-03 4:27
jeremysay14-Feb-03 4:27 
GeneralRe: Compare two bitmap Pin
MAAK14-Feb-03 6:14
MAAK14-Feb-03 6:14 
GeneralRe: Compare two bitmap Pin
jeremysay14-Feb-03 10:23
jeremysay14-Feb-03 10:23 
GeneralRe: Compare two bitmap Pin
MAAK14-Feb-03 15:13
MAAK14-Feb-03 15:13 
GeneralRe: Compare two bitmap Pin
jeremysay14-Feb-03 21:48
jeremysay14-Feb-03 21:48 
MAAK wrote:
Hope you are not disappointed

arf... a litlle bit

MAAK wrote:
HBITMAP hbmp = im.Detach(); //you now have handle to DIB ready for use
ok now i can work with hbmp and it will work fine?

i try to compare the same bitmap :
BITMAP bmp1, bmp2;

GetObject(hbmp, sizeof(hbmp), &bmp1); //get the first bitmap's data
GetObject(hbmp, sizeof(hbmp), &bmp2); //get the first bitmap's data

if(memcmp(&bmp1, &bmp2, sizeof(bmp1) - sizeof(bmp1.bmBits)))
{
    AfxMessageBox("Prob");
}
else
{
    //get the bits of both bitmaps
    LPBYTE data1 = (LPBYTE)bmp1.bmBits,     data2 = (LPBYTE)bmp2.bmBits;
    //the number of bytes per width
    DWORD bmWidth = bmp1.bmWidth * (bmp1.bmBitsPixel / 8);
    //somthing is wrong with bmWidthBytes member in Win9x and Win2k
    //so it's better to calculate the offset yourself
    DWORD bmWidthBytes = bmWidth + (2 - bmWidth % 2) * bool(bmWidth % 2);
    //number of bytes in data1 and data2
    DWORD bytesize = bmp1.bmHeight * bmWidthBytes;
    //compare the two bitmap's bits
    if(memcmp(data1, data2, bytesize) == 0)
        AfxMessageBox("gooooooooooooooood");
}

but i have the same error Confused | :confused:
there is something which I did not understand?
GeneralRe: Compare two bitmap Pin
MAAK14-Feb-03 23:14
MAAK14-Feb-03 23:14 
GeneralRe: Compare two bitmap Pin
jeremysay17-Feb-03 3:10
jeremysay17-Feb-03 3:10 
GeneralRe: Compare two bitmap Pin
jeremysay14-Feb-03 5:01
jeremysay14-Feb-03 5:01 
GeneralRe: Compare two bitmap Pin
includeh1014-Feb-03 23:57
includeh1014-Feb-03 23:57 
GeneralMFC accelerators & activeX Pin
peterchen13-Feb-03 22:47
peterchen13-Feb-03 22:47 
GeneralGet the HWND value of a Dialog Pin
Willem B13-Feb-03 22:41
Willem B13-Feb-03 22:41 
GeneralRe: Get the HWND value of a Dialog Pin
bryce13-Feb-03 22:50
bryce13-Feb-03 22:50 
GeneralRe: Get the HWND value of a Dialog Pin
Willem B13-Feb-03 23:03
Willem B13-Feb-03 23:03 
GeneralRe: Get the HWND value of a Dialog Pin
bryce13-Feb-03 23:08
bryce13-Feb-03 23:08 
GeneralRe: Get the HWND value of a Dialog Pin
Willem B13-Feb-03 23:13
Willem B13-Feb-03 23:13 
Generalhide titlebar Pin
bryce13-Feb-03 22:25
bryce13-Feb-03 22:25 
GeneralRe: hide titlebar Pin
Hans Ruck13-Feb-03 23:07
Hans Ruck13-Feb-03 23:07 
Generalissue caused precompiled header Pin
dsuratman13-Feb-03 20:38
dsuratman13-Feb-03 20:38 
GeneralRe: issue caused precompiled header Pin
Michael Dunn13-Feb-03 23:30
sitebuilderMichael Dunn13-Feb-03 23:30 
Generaldev Pin
Anonymous13-Feb-03 19:28
Anonymous13-Feb-03 19:28 
Generaluint40 Pin
Victor Boctor13-Feb-03 18:10
Victor Boctor13-Feb-03 18:10 
GeneralRe: uint40 Pin
Joaquín M López Muñoz13-Feb-03 20:13
Joaquín M López Muñoz13-Feb-03 20:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.