Click here to Skip to main content
15,915,600 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: full code for comparing bitmaps Pin
Michael Schubert6-Oct-08 0:46
Michael Schubert6-Oct-08 0:46 
GeneralRe: full code for comparing bitmaps Pin
kaushal kishore sharma6-Oct-08 0:51
kaushal kishore sharma6-Oct-08 0:51 
GeneralRe: full code for comparing bitmaps Pin
Rajesh R Subramanian6-Oct-08 0:56
professionalRajesh R Subramanian6-Oct-08 0:56 
GeneralRe: full code for comparing bitmaps Pin
Michael Schubert6-Oct-08 1:01
Michael Schubert6-Oct-08 1:01 
AnswerRe: full code for comparing bitmaps Pin
CPallini6-Oct-08 0:52
mveCPallini6-Oct-08 0:52 
GeneralRe: full code for comparing bitmaps Pin
Rajesh R Subramanian6-Oct-08 0:54
professionalRajesh R Subramanian6-Oct-08 0:54 
GeneralRe: full code for comparing bitmaps Pin
CPallini6-Oct-08 0:55
mveCPallini6-Oct-08 0:55 
GeneralRe: full code for comparing bitmaps Pin
kaushal kishore sharma6-Oct-08 0:56
kaushal kishore sharma6-Oct-08 0:56 
pallini..thnx..but i need a full running code for comparing 2 bitmaps..
i have posted my code but i cant understand what is wrong in my code...
can you help please..


1.
void CPixelView::OnDraw(CDC* pDC)
{
CPixelDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
{
COLORREF color[255][255],color1[255][255];


CBitmap bitmap,bitmap1;
CString file1,file2,strText;
file1.Format("C:\\1.bmp");
file2.Format("C:\\3.bmp");
CDC dcMemory,dcMemory1;
int r[255][255],R[255][255];
// 1st image HBITMAP hBitmap1 = (HBITMAP)::LoadImage(NULL,file1,IMAGE_BITMAP, 0, 0,LR_LOADFROMFILE );//| LR_CREATEDIBSECTION);
//2nd image HBITMAP hBitmap2 = (HBITMAP)::LoadImage(NULL,file2,IMAGE_BITMAP, 0, 0,LR_LOADFROMFILE );
// Attach the loaded image to the CBitmap object.
bitmap.Attach(hBitmap1);
bitmap1.Attach(hBitmap2);
dcMemory.CreateCompatibleDC(pDC);
dcMemory.SelectObject(&bitmap);
dcMemory1.CreateCompatibleDC(pDC);
dcMemory1.SelectObject(&bitmap1);
pDC->BitBlt(0,0,200,200,&dcMemory,0,0,SRCCOPY);
pDC->BitBlt(0,0,300,700,&dcMemory1,0,0,SRCCOPY);
//for all the pixels
for(int i=0;i<48;i++)
{
for(int j=0;j<48;j++)
{
HDC hDC = ::GetDC(this->GetSafeHwnd());

color[i][j] = ::GetPixel(hDC,i,j);
::ReleaseDC(this->GetSafeHwnd(), hDC);
r[i][j]=GetRValue(color[i][j]);

HDC hDC1 = ::GetDC(this->GetSafeHwnd());

color1[i][j] = ::GetPixel(hDC1,i,j);
::ReleaseDC(this->GetSafeHwnd(), hDC1);
R[i][j]=GetRValue(color1[i][j]);
}
}//got the pixel values


}
}
GeneralRe: full code for comparing bitmaps Pin
Michael Schubert6-Oct-08 0:59
Michael Schubert6-Oct-08 0:59 
GeneralRe: full code for comparing bitmaps Pin
Maximilien6-Oct-08 1:02
Maximilien6-Oct-08 1:02 
AnswerRe: full code for comparing bitmaps Pin
kaushal kishore sharma6-Oct-08 5:50
kaushal kishore sharma6-Oct-08 5:50 
GeneralRe: full code for comparing bitmaps Pin
Michael Schubert6-Oct-08 0:59
Michael Schubert6-Oct-08 0:59 
GeneralRe: full code for comparing bitmaps Pin
Hamid_RT6-Oct-08 4:56
Hamid_RT6-Oct-08 4:56 
GeneralRe: full code for comparing bitmaps Pin
CPallini6-Oct-08 6:20
mveCPallini6-Oct-08 6:20 
GeneralRe: full code for comparing bitmaps Pin
Hamid_RT6-Oct-08 7:56
Hamid_RT6-Oct-08 7:56 
AnswerRe: full code for comparing bitmaps Pin
Sauce!6-Oct-08 4:30
Sauce!6-Oct-08 4:30 
AnswerRe: full code for comparing bitmaps Pin
Hamid_RT6-Oct-08 5:03
Hamid_RT6-Oct-08 5:03 
AnswerRe: full code for comparing bitmaps Pin
PJ Arends6-Oct-08 6:13
professionalPJ Arends6-Oct-08 6:13 
QuestionProblem with ActivaX Control Pin
hari_honey6-Oct-08 0:24
hari_honey6-Oct-08 0:24 
QuestionDialog toolbar problem Pin
followait5-Oct-08 22:28
followait5-Oct-08 22:28 
AnswerRe: Dialog toolbar problem Pin
PravinSingh6-Oct-08 0:28
PravinSingh6-Oct-08 0:28 
GeneralRe: Dialog toolbar problem Pin
followait6-Oct-08 3:20
followait6-Oct-08 3:20 
AnswerRe: Dialog toolbar problem Pin
PravinSingh6-Oct-08 21:21
PravinSingh6-Oct-08 21:21 
QuestionCan anyone tell what is wromg with this code Pin
kaushal kishore sharma5-Oct-08 22:20
kaushal kishore sharma5-Oct-08 22:20 
AnswerRe: Can anyone tell what is wromg with this code Pin
CPallini5-Oct-08 22:35
mveCPallini5-Oct-08 22:35 

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.