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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
| CBitmap Gus,MemAAff,tmp,Banc;
CDC MemDC,MemDCBuffer;
CDC *pDC=this->GetDC();
//(...)
Gus.LoadBitmap(IDB_GUS);
BITMAP InfosBmp;
Gus.GetBitmap(&InfosBmp);
MemDCBuffer.CreateCompatibleDC(pDC);
MemDC.CreateCompatibleDC(pDC);
MemAAff.CreateCompatibleBitmap(pDC,640,480);
CBitmap* pOldBmp = MemDC.SelectObject(&MemAAff);
//(...)
//Preaffichage en memoire
CRect crect;
crect.SetRect(0,0,640,480);
MemDC.FillSolidRect(&crect,RGB(255,255,255));//fond blanc
MemDCBuffer.SelectObject(&Gus);
MemDC.PlgBlt(Points,&MemDCBuffer,0,0,InfosBmp.bmWidth, InfosBmp.bmHeight,tmp,0,0);//Affichage du gus
tagPOINT PointsPlg[4];
PointsPlg[0].x = xcentrerot-dist_bas - 4;
PointsPlg[0].y = 480;
PointsPlg[2].x = xcentrerot+dist_haut - 4;
PointsPlg[2].y = 0;
PointsPlg[1].x = xcentrerot-dist_bas + 4;
PointsPlg[1].y = 480;
PointsPlg[3].x = xcentrerot+dist_haut + 4;
PointsPlg[3].y = 0;
CBrush brA;
brA.CreateSolidBrush( RGB(102, 102, 204) );
CRgn Rgn;
Rgn.CreatePolygonRgn(PointsPlg,4,ALTERNATE);
MemDC.FrameRgn( &Rgn, &brA, 4, 4 ); //Affichage de la ligne
//Affichage de l'image memoire
pDC->BitBlt(20,20,640,480,&MemDC,0,0,SRCCOPY);
//(...)
MemDC.SelectObject(pOldBmp);
DeleteObject(MemDC);
ReleaseDC(pDC); |
Partager