Click here to Skip to main content
15,922,696 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How can I get a HBITMAP handle from a CImageList Object? Pin
Hamid_RT25-Aug-06 1:31
Hamid_RT25-Aug-06 1:31 
See
m_ImageList->GetImageInfo(...);
-----------------------And-----------
You can use From ExtractIcon(index) for get a hicon of list and
draw this icon to a dc and save this dc to a bitmap
this code is an idea maybe its not good but if you want to checking this code its working.
<br />
CImageList* m_ImageList;<br />
CBitmap		Bmp;<br />
m_ImageList=new CImageList();<br />
m_ImageList->Create(32,32, ILC_COLORDDB,0,0);<br />
Bmp.LoadBitmap(IDB_BITMAP1);<br />
<br />
m_ImageList->Add(&Bmp,RGB(100,105,0));<br />
m_ImageList->Add(&Bmp,RGB(100,105,0));<br />
<br />
CDC dc;<br />
CBitmap p;<br />
CImage m;<br />
dc.CreateCompatibleDC(GetDC());<br />
p.CreateCompatibleBitmap(GetDC(),32,32);<br />
dc.SelectObject(p);<br />
<br />
for (int i=0;i < m_ImageList->GetImageCount();i++)<br />
{<br />
   dc.DrawIcon(0, 0, m_ImageList->ExtractIcon(i));<br />
   //dc.SelectObject(p);<br />
   m.Attach(p);<br />
   m.Save("c:\\0.bmp");<br />
   m.Detach();<br />
}<br />
<br />
//now free resources...<br />
<br />





WhiteSky


GeneralRe: How can I get a HBITMAP handle from a CImageList Object? [modified] Pin
Tcpip200525-Aug-06 1:51
Tcpip200525-Aug-06 1:51 
QuestionRe: How can I get a HBITMAP handle from a CImageList Object? Pin
prasad_som25-Aug-06 2:11
prasad_som25-Aug-06 2:11 
AnswerRe: How can I get a HBITMAP handle from a CImageList Object? Pin
Tcpip200525-Aug-06 2:15
Tcpip200525-Aug-06 2:15 
GeneralRe: How can I get a HBITMAP handle from a CImageList Object? Pin
prasad_som25-Aug-06 2:25
prasad_som25-Aug-06 2:25 
GeneralRe: How can I get a HBITMAP handle from a CImageList Object? Pin
Hamid_RT25-Aug-06 3:10
Hamid_RT25-Aug-06 3:10 
GeneralRe: How can I get a HBITMAP handle from a CImageList Object? Pin
prasad_som25-Aug-06 3:12
prasad_som25-Aug-06 3:12 
GeneralRe: How can I get a HBITMAP handle from a CImageList Object? Pin
Hamid_RT25-Aug-06 2:23
Hamid_RT25-Aug-06 2:23 
GeneralRe: How can I get a HBITMAP handle from a CImageList Object? Pin
Tcpip200525-Aug-06 3:35
Tcpip200525-Aug-06 3:35 
GeneralRe: How can I get a HBITMAP handle from a CImageList Object? Pin
Hamid_RT25-Aug-06 3:50
Hamid_RT25-Aug-06 3:50 
GeneralRe: How can I get a HBITMAP handle from a CImageList Object? Pin
Tcpip200525-Aug-06 17:07
Tcpip200525-Aug-06 17:07 
GeneralRe: How can I get a HBITMAP handle from a CImageList Object? Pin
Hamid_RT26-Aug-06 1:02
Hamid_RT26-Aug-06 1:02 
GeneralRe: How can I get a HBITMAP handle from a CImageList Object? Pin
mathievp24-Mar-09 8:37
mathievp24-Mar-09 8:37 
QuestionSid in report event function Pin
ashokvishnu25-Aug-06 0:54
ashokvishnu25-Aug-06 0:54 
QuestionC function for parsing string array? Pin
9ine25-Aug-06 0:38
9ine25-Aug-06 0:38 
AnswerRe: C function for parsing string array? Pin
Anonymuos25-Aug-06 0:52
Anonymuos25-Aug-06 0:52 
AnswerRe: C function for parsing string array? Pin
toxcct25-Aug-06 3:01
toxcct25-Aug-06 3:01 
GeneralRe: C function for parsing string array? Pin
Anonymuos25-Aug-06 6:03
Anonymuos25-Aug-06 6:03 
AnswerRe: C function for parsing string array? Pin
Zac Howland25-Aug-06 6:41
Zac Howland25-Aug-06 6:41 
AnswerRe: C function for parsing string array? [modified] Pin
Stephen Hewitt26-Aug-06 3:18
Stephen Hewitt26-Aug-06 3:18 
Questionbasic question in C++ Pin
Green Fuze25-Aug-06 0:37
Green Fuze25-Aug-06 0:37 
AnswerRe: basic question in C++ Pin
prasad_som25-Aug-06 1:54
prasad_som25-Aug-06 1:54 
GeneralRe: basic question in C++ Pin
Green Fuze25-Aug-06 2:10
Green Fuze25-Aug-06 2:10 
GeneralRe: basic question in C++ Pin
Kevin McFarlane27-Aug-06 8:32
Kevin McFarlane27-Aug-06 8:32 
AnswerRe: basic question in C++ Pin
Nish Nishant26-Aug-06 3:28
sitebuilderNish Nishant26-Aug-06 3:28 

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.