Click here to Skip to main content
15,917,565 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questiondialog on top of another app's window? Pin
Peter Weyzen6-Jun-05 10:21
Peter Weyzen6-Jun-05 10:21 
AnswerRe: dialog on top of another app's window? Pin
David Crow7-Jun-05 2:46
David Crow7-Jun-05 2:46 
GeneralSocket Issue Pin
Identity Undisclosed6-Jun-05 9:32
Identity Undisclosed6-Jun-05 9:32 
GeneralRe: Socket Issue Pin
Nilesh K.6-Jun-05 18:23
Nilesh K.6-Jun-05 18:23 
GeneralRe: Socket Issue Pin
ThatsAlok6-Jun-05 18:34
ThatsAlok6-Jun-05 18:34 
QuestionHow do save a screen to a bitmap Pin
bkphat6-Jun-05 9:13
bkphat6-Jun-05 9:13 
AnswerRe: How do save a screen to a bitmap Pin
Ravi Bhavnani6-Jun-05 10:14
professionalRavi Bhavnani6-Jun-05 10:14 
AnswerRe: How do save a screen to a bitmap Pin
ucc8016-Jun-05 17:56
ucc8016-Jun-05 17:56 
You need to create a memory bitmap at first and then drawing it on this memory bitmap,when finished,please convert CBitmap to bitmap file,I think the following sample codes to be useful to you (You cann't build it,it is only a sample):

BOOL CMyCanvasCore::DoDrawImage(CImage* pImage, CDC* pDC)
{
BOOL bSuccess = FALSE;
CDC dcMem;
CBitmap bmp;
CDC dcScreen;

dcScreen.Attach(::GetDC(0));

if (pDC == NULL)
{
pDC = &dcScreen;
}

dcMem.CreateCompatibleDC(pDC);

CRect rcVirtual(GetVirtualOrigin(), GetVirtualSize());
CSize szBitmap(rcVirtual.Width(), rcVirtual.Height());

PrepareDrawDC(pDC, FALSE);
pDC->LPtoDP(&szBitmap);

BOOL bBmpCreated = bmp.CreateCompatibleBitmap(pDC, szBitmap.cx, szBitmap.cy);

if (bBmpCreated)
{
dcMem.SelectObject(&bmp);

const CPoint ptOldLogOrg = GetLogOrigin();

CRect rcMargins;
GetMargins(rcMargins);
CSize szMargins(rcMargins.left, rcMargins.top);
FODPtoLP(&szMargins);

CPoint ptTopLeft(GetVirtualOrigin());
ptTopLeft.x += szMargins.cx;

ptTopLeft.y += szMargins.cy;

SetLogOrigin(ptTopLeft.x, ptTopLeft.y);

PrepareDrawDC(&dcMem, FALSE);

// Draw background.
DoDrawBackGround(&dcMem,rcVirtual);

GetCurrentModel()->OnDrawShapeNormal(&dcMem);

SetLogOrigin(ptOldLogOrg.x, ptOldLogOrg.y);

// pImage->MakeNewBitmap(&dcMem, &bmp);

bSuccess = TRUE;
}

dcScreen.Detach();

return bSuccess;
}

Jack

---------------------------------------------------------------------------------
XD++ MFC/C++ Flow/Diagram Library -- http://www.ucancode.net

AnswerRe: How do save a screen to a bitmap Pin
ThatsAlok6-Jun-05 19:05
ThatsAlok6-Jun-05 19:05 
GeneralEmulating Windows Task Manager CPU Usage and history applets Pin
Anonymous6-Jun-05 9:10
Anonymous6-Jun-05 9:10 
GeneralRe: Emulating Windows Task Manager CPU Usage and history applets Pin
Ravi Bhavnani6-Jun-05 10:16
professionalRavi Bhavnani6-Jun-05 10:16 
GeneralWin32 - How to Clip a window Pin
dirkhelmet6-Jun-05 7:43
dirkhelmet6-Jun-05 7:43 
Generalworker thread and free Pin
Pasquale826-Jun-05 6:37
Pasquale826-Jun-05 6:37 
GeneralRe: worker thread and free Pin
Blake Miller6-Jun-05 6:51
Blake Miller6-Jun-05 6:51 
GeneralRe: worker thread and free Pin
Anonymous6-Jun-05 7:33
Anonymous6-Jun-05 7:33 
GeneralRe: worker thread and free Pin
Blake Miller6-Jun-05 7:43
Blake Miller6-Jun-05 7:43 
GeneralRe: worker thread and free Pin
Pasquale826-Jun-05 8:24
Pasquale826-Jun-05 8:24 
GeneralRe: worker thread and free Pin
Blake Miller6-Jun-05 8:33
Blake Miller6-Jun-05 8:33 
GeneralRe: worker thread and free Pin
Pasquale826-Jun-05 8:51
Pasquale826-Jun-05 8:51 
GeneralRe: worker thread and free Pin
Blake Miller6-Jun-05 10:51
Blake Miller6-Jun-05 10:51 
QuestionHow to open an existing file and save it under a new name Pin
j_s_lacroix6-Jun-05 6:31
j_s_lacroix6-Jun-05 6:31 
AnswerRe: How to open an existing file and save it under a new name Pin
David Crow6-Jun-05 6:56
David Crow6-Jun-05 6:56 
GeneralOpen existing file and Save it under a new name Pin
j_s_lacroix6-Jun-05 6:28
j_s_lacroix6-Jun-05 6:28 
GeneralRe: Open existing file and Save it under a new name Pin
Andy Moore6-Jun-05 7:41
Andy Moore6-Jun-05 7:41 
GeneralBig endian to little endian conversion Pin
softtec6-Jun-05 6:26
softtec6-Jun-05 6:26 

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.