Bonjour,
je suis entrain de réaliser actuellement une application à base de boite de dialogue pour windows mobile 6.
Je cherche une méthode qui va me permettre de convertir une image couleur en niveau de gris.
voici mon code qui permet d'afficher l'image couleur normal.
je voudrais que l'image puisse se convertir et s'afficher en niveau gris en cliquant sur un autre bouton de mon application.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 //Affichage de l'image en couleur void CcameraDlg::OnBnClickedButton6() { CDC * pDC = GetDC(); HBITMAP Hbitmap=SHLoadImageFile(_T("\\My Documents\\test.jpg")); if(Hbitmap) { CBitmap bitmap; bitmap.Attach(Hbitmap); BITMAP bmpInfo; bitmap.GetBitmap(&bmpInfo); CDC bitmapDC; bitmapDC.CreateCompatibleDC(pDC); bitmapDC.SelectObject(&bitmap); CRect RC; GetClientRect(&RC); pDC->StretchBlt(0, 0, RC.Width(), RC.Height(), &bitmapDC, 0, 0, bmpInfo.bmWidth, bmpInfo.bmHeight, SRCCOPY); bitmapDC.DeleteDC(); bitmap.DeleteObject(); } }
merci par avance de votre aide
Partager