Click here to Skip to main content
15,113,873 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to copy from CBitmap to CBitmap Pin
Hamid_RT6-Jun-06 19:56
MemberHamid_RT6-Jun-06 19:56 
AnswerRe: How to copy from CBitmap to CBitmap Pin
ThatsAlok6-Jun-06 2:59
MemberThatsAlok6-Jun-06 2:59 
GeneralRe: How to copy from CBitmap to CBitmap Pin
gomez_a6-Jun-06 3:43
Membergomez_a6-Jun-06 3:43 
GeneralRe: How to copy from CBitmap to CBitmap Pin
Hamid_RT6-Jun-06 3:52
MemberHamid_RT6-Jun-06 3:52 
GeneralRe: How to copy from CBitmap to CBitmap Pin
gomez_a6-Jun-06 6:24
Membergomez_a6-Jun-06 6:24 
GeneralRe: How to copy from CBitmap to CBitmap Pin
Hamid_RT6-Jun-06 19:57
MemberHamid_RT6-Jun-06 19:57 
GeneralRe: How to copy from CBitmap to CBitmap Pin
gomez_a7-Jun-06 0:45
Membergomez_a7-Jun-06 0:45 
GeneralRe: How to copy from CBitmap to CBitmap Pin
Hamid_RT7-Jun-06 3:03
MemberHamid_RT7-Jun-06 3:03 
Hope I understood your question

<br />
void CAnswerDlg::OnBnClickedTest()<br />
{<br />
CBitmapViewer *mNewBitmap;<br />
CBitmap bmp_part;<br />
bmp_part.Attach((HBITMAP)LoadImage(AfxGetInstanceHandle(),"c:\\0.bmp",IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE|LR_CREATEDIBSECTION));<br />
<br />
CRect R3;<br />
mNewBitmap = new CBitmapViewer();<br />
mNewBitmap->Create(this, R3, 1); // CRect R3 - where the window is placed<br />
mNewBitmap->SetBitmap2(&bmp_part);<br />
mNewBitmap->DestroyWindow();<br />
<br />
/*<br />
if you use this code you see one file<br />
CImage m;<br />
m.Attach(mNewBitmap->m_Bitmap);<br />
m.Save("c:\\test.bmp");<br />
m.Detach();*/<br />
}<br />
<br />
BOOL CBitmapViewer::Create(CWnd* pParentWnd, const RECT& rect,UINT nID,DWORD dwStyle)<br />
{<br />
return CWnd::Create("CBitmapViewer","",dwStyle,rect,pParentWnd,1,0);<br />
}<br />
<br />
BOOL CBitmapViewer::SetBitmap(UINT nIDResource)<br />
{<br />
return m_Bitmap.LoadBitmap(nIDResource);<br />
}<br />
<br />
void CBitmapViewer::SetBitmap2(CBitmap *m)<br />
{<br />
	m_Bitmap.Attach((HBITMAP)m->m_hObject);<br />
}<br />



whitesky


GeneralRe: How to copy from CBitmap to CBitmap Pin
ThatsAlok6-Jun-06 19:13
MemberThatsAlok6-Jun-06 19:13 
QuestionShared Memory Writing Pin
velayudhan_raj6-Jun-06 2:03
Membervelayudhan_raj6-Jun-06 2:03 
AnswerRe: Shared Memory Writing Pin
Laxman Auti6-Jun-06 2:13
MemberLaxman Auti6-Jun-06 2:13 
GeneralRe: Shared Memory Writing Pin
velayudhan_raj6-Jun-06 2:15
Membervelayudhan_raj6-Jun-06 2:15 
GeneralRe: Shared Memory Writing Pin
ThatsAlok6-Jun-06 2:57
MemberThatsAlok6-Jun-06 2:57 
AnswerRe: Shared Memory Writing Pin
Viorel.6-Jun-06 2:29
MemberViorel.6-Jun-06 2:29 
AnswerRe: Shared Memory Writing Pin
Hamid_RT6-Jun-06 2:41
MemberHamid_RT6-Jun-06 2:41 
AnswerRe: Shared Memory Writing Pin
James R. Twine6-Jun-06 4:13
MemberJames R. Twine6-Jun-06 4:13 
QuestionKernal32.lib .....Error at run Pin
zahid_ash6-Jun-06 1:55
Memberzahid_ash6-Jun-06 1:55 
AnswerRe: Kernal32.lib .....Error at run Pin
_AnsHUMAN_ 6-Jun-06 2:04
Member_AnsHUMAN_ 6-Jun-06 2:04 
QuestionRe: Kernal32.lib .....Error at run Pin
David Crow6-Jun-06 4:31
MemberDavid Crow6-Jun-06 4:31 
Questioncompiler creation Pin
c076-Jun-06 1:46
Memberc076-Jun-06 1:46 
AnswerRe: compiler creation Pin
Sarath C6-Jun-06 2:01
MemberSarath C6-Jun-06 2:01 
GeneralRe: compiler creation Pin
c076-Jun-06 5:00
Memberc076-Jun-06 5:00 
QuestionMouse move event Pin
RajiRaghu6-Jun-06 1:43
MemberRajiRaghu6-Jun-06 1:43 
Questionconversion to _bstr_t - newbie Pin
antonaras6-Jun-06 1:29
Memberantonaras6-Jun-06 1:29 
AnswerRe: conversion to _bstr_t - newbie Pin
Sarath C6-Jun-06 1:37
MemberSarath C6-Jun-06 1:37 

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.