Click here to Skip to main content
15,892,746 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalmemcmp & bitmaps Pin
dave2k24-Aug-05 0:13
dave2k24-Aug-05 0:13 
GeneralRe: memcmp & bitmaps Pin
Anonymous24-Aug-05 3:58
Anonymous24-Aug-05 3:58 
GeneralAdding new column dynamically in CXListCtrl adds progress control and check boxs... Pin
Ravi Sankar S23-Aug-05 23:58
Ravi Sankar S23-Aug-05 23:58 
GeneralAssistance required on Bitmaps Pin
Barm23-Aug-05 23:50
Barm23-Aug-05 23:50 
GeneralRe: Assistance required on Bitmaps Pin
Steve S23-Aug-05 23:54
Steve S23-Aug-05 23:54 
GeneralRe: Assistance required on Bitmaps Pin
Barm24-Aug-05 0:01
Barm24-Aug-05 0:01 
GeneralRe: Assistance required on Bitmaps Pin
Hamed Musavi24-Aug-05 1:19
Hamed Musavi24-Aug-05 1:19 
GeneralRe: Assistance required on Bitmaps Pin
Achim Klein24-Aug-05 8:14
Achim Klein24-Aug-05 8:14 
Hi,

create a CStatic control and choose type 'rectangle'.
Use the following code to draw into that window.

void DrawBitmap(CBitmap* pBitmap, CWnd* pWindow, CPoint Offset)
{
	// get bitmap information
	BITMAP bmpInfo;
	pBitmap->GetObject(sizeof(bmpInfo), &bmpInfo);

	// get source size
	CSize srcSize;
	srcSize.cx = bmpInfo.bmWidth;
	srcSize.cy = bmpInfo.bmHeight;

	// get window's client device context
	CClientDC* pDC = new CClientDC(pWindow);

	// create compatible divice context for stretching
	CDC* memDC = new CDC; memDC->CreateCompatibleDC(pDC);

	// load bitmap in original size
	CBitmap* old = memDC->SelectObject(pBitmap);

	// copy bitmap data
	pDC->BitBlt(Offset.x, Offset.y, srcSize.cx, srcSize.cy, memDC, 0, 0, SRCCOPY);

	// reselect first bitmap
	memDC->SelectObject(old);

	// delete device context and reset pointer
	delete memDC; memDC = 0;

	// delete device context and reset pointer
	delete pDC; pDC = 0;
}


Regards

If I have seen further, it is by standing on the shoulders of giants.
Isaac Newton
GeneralCheckBox control problem Pin
Mukhan23-Aug-05 22:43
Mukhan23-Aug-05 22:43 
GeneralRe: CheckBox control problem Pin
Rage23-Aug-05 22:48
professionalRage23-Aug-05 22:48 
GeneralRe: CheckBox control problem Pin
Mukhan23-Aug-05 23:02
Mukhan23-Aug-05 23:02 
GeneralFile Transfer Using UDP Pin
yccheok23-Aug-05 22:17
yccheok23-Aug-05 22:17 
GeneralRe: File Transfer Using UDP Pin
Alexander M.,23-Aug-05 22:37
Alexander M.,23-Aug-05 22:37 
GeneralRe: File Transfer Using UDP Pin
Nemanja Trifunovic24-Aug-05 2:51
Nemanja Trifunovic24-Aug-05 2:51 
GeneralRe: File Transfer Using UDP Pin
yccheok24-Aug-05 15:50
yccheok24-Aug-05 15:50 
Generalautofill script for login box Pin
joshuatree23-Aug-05 21:22
joshuatree23-Aug-05 21:22 
GeneralRe: autofill script for login box Pin
Rage23-Aug-05 22:01
professionalRage23-Aug-05 22:01 
GeneralRe: autofill script for login box Pin
Cedric Moonen23-Aug-05 22:19
Cedric Moonen23-Aug-05 22:19 
GeneralRe: autofill script for login box Pin
Jose Lamas Rios24-Aug-05 8:32
Jose Lamas Rios24-Aug-05 8:32 
GeneralRe: autofill script for login box Pin
joshuatree24-Aug-05 15:42
joshuatree24-Aug-05 15:42 
QuestionWhat control to use? Pin
Ali Tavakol23-Aug-05 19:59
Ali Tavakol23-Aug-05 19:59 
AnswerRe: What control to use? Pin
Rage23-Aug-05 22:13
professionalRage23-Aug-05 22:13 
AnswerRe: What control to use? Pin
Rage23-Aug-05 23:29
professionalRage23-Aug-05 23:29 
AnswerRe: What control to use? Pin
David Crow24-Aug-05 8:11
David Crow24-Aug-05 8:11 
QuestionHow to launch 'System Restore' point thru pgm in Win XP? Pin
Supriya Tonape23-Aug-05 19:55
Supriya Tonape23-Aug-05 19:55 

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.