bowebay
January 25th, 2009, 12:59 PM
I'm a beginner with Windows Forms and am attempting to re-implement an application developed in MFC.
In the MFC implementation I had a bitmap in the bitmap resources of the project as (IDB_RDBSIG1). I was able to access and print the bitmap with the following code.
CBitmap bmpSig;
bmpSig.LoadBitmap(IDB_RDBSIG1);
BITMAP bm;
bmpSig.GetObject(sizeof(BITMAP), &bm);
CDC dcMem;
dcMem.CreateCompatibleDC(pDC);
CBitmap* pbmpOld = dcMem.SelectObject(&bmpSig);
pt.x = 20;
pt.y = 30;
pDC->BitBlt(pt.x,pt.y,bm.bmWidth,bm.bmHeight,&dcMem,0,0,SRCCOPY);
dcMem.SelectObject(pbmpOld);
I have been unable to find or generate an equivalent implementation for Windows Forms. Any help or guidance would be greatly appreciated.
In the MFC implementation I had a bitmap in the bitmap resources of the project as (IDB_RDBSIG1). I was able to access and print the bitmap with the following code.
CBitmap bmpSig;
bmpSig.LoadBitmap(IDB_RDBSIG1);
BITMAP bm;
bmpSig.GetObject(sizeof(BITMAP), &bm);
CDC dcMem;
dcMem.CreateCompatibleDC(pDC);
CBitmap* pbmpOld = dcMem.SelectObject(&bmpSig);
pt.x = 20;
pt.y = 30;
pDC->BitBlt(pt.x,pt.y,bm.bmWidth,bm.bmHeight,&dcMem,0,0,SRCCOPY);
dcMem.SelectObject(pbmpOld);
I have been unable to find or generate an equivalent implementation for Windows Forms. Any help or guidance would be greatly appreciated.