mfc >> What's the deal with CImageList?

by mdnightman » Sat, 25 Mar 2006 05:07:14 GMT

Could something explain to me why CImageList::Add allows you to add a
bitmap or an icon, but there's only CImageList::ExtractIcon available?

How do you extract a bitmap then?
Is it possible to convert a bitmap to an icon of the same size (16x16)?
It seems everything I tried convert a bitmap (16x16) to a (32x32) icon?

Please help,
Thank you in advance!



mfc >> What's the deal with CImageList?

by AliR » Sat, 25 Mar 2006 06:21:37 GMT


Because normally once you add your bitmap to the CImageList you would use
CImageList::Draw to draw it. If you simply want a list of images, then use
CArray<CBitmap>.


AliR.








Similar Threads

1. What's the deal with Crystal Reports?

"Bob Johnson" < XXXX@XXXXX.COM > wrote in message 
news: XXXX@XXXXX.COM ...
> In this NG late last week someone asked about reporting in .NET. I 
> suggested going with ActiveReports and to avoid Crystal Reports. A bunch 
> of you piled on and not only concurred that Crystal sucks - but went 
> beyond that.

I'm not that sure about Crystal but have used AR for many years. While AR is 
pretty good it's not perfect and has some really stupid bugs that take ages 
to get fixed.

Michael 


2. OT: What's the deal with Crystal Reports? - CSharp/C#

3. CImageList::Create(CImageList *pImageList) won't link

When I call this version of the create method:

BOOL Create( CImageList* pImageList );

It compiles fine but won't link in Windows CE (or PPC).  It links fine when 
build in Windows.  What library would I need to link to for this?  Thanks.

Timothy Dean 


4. What's dispinterface and what's the difference between

5. What's meaning and what's wrong with this code?

Used Type Library editor, I generate a function name GetBoundRect like
below:

STDMETHODIMP TMCObjectImpl::GetBoundRect(ISpyRect* rect)
{
  ISpyRectPtr rectPtr(rect, true); //what's meaning?
}

and ISpyRect is a record that created by Type Library Editor.

I don't find any declaration of ISpyRect and this function can't be comiled.
What's wrong?




6. What's the deal with List View ignoring LVIF_STATE in OnLvnGetdispinfo Microsoft, please comment !

7. TTabSheet: What's wrong with this simple code?TTabSheet: What's wrong with this simple code?TTabSheet: What's wrong with this simple code?

I recently noticed that if you have 'TUpDown' connected to some 'TEdit'
(with 'Associate' property) on some 'TabSheet' the 'OnChange' event of
'TEdit' is automatically fired the FIRST time you visit (select) that 'TabSheet'.
I personally think that's the funny thing but I do not want to meddle right now.
That behavior was inadmissible for me because it was the question of Options
form with 'Apply' button that has to be enabled every time that something changes.
It's not the problem to write additional code for pre-checking the value of
'TEdit' and disable 'Apply' button if it realizes that the values are same...

I needed a way to PROGRAMMATICALLY produce the situation that you have
selected (visited, clicked, ...) the 'TabSheet' for the first time.

Setting the 'Visible' property of 'TabSheet' in a loop to TRUE seemed to solve
the problem, but there were some side effect I cannot understand.

Please produce the situation:

1) Add 'PageControl1' to 'Form1'
1) Add 'TabSheet1' and 'TabSheet2' to 'PageControl1'
2) Add 'Button1' to 'TabSheet1' (Adding Buttons is significant to 'see' the problem)
3) Add 'Button2' to 'TabSheet2'
4) Add the code in the 'Form1's' constructor: 

   a) FIRST BUILD
   --------------
   __fastcall TForm1::TForm1(TComponent* Owner)
           : TForm(Owner)
   {
      PageControl1->ActivePage = TabSheet1; // Secure to focus the first TabSheet
      TabSheet2->Visible = true;
   }

   b) SECOND BUILD
   ---------------
   __fastcall TForm1::TForm1(TComponent* Owner)
           : TForm(Owner)
   {
      PageControl1->ActivePage = TabSheet1; // Secure to focus the first TabSheet
      TabSheet2->Visible = true;
      TabSheet1->Visible = true;
   }

   c) THIRD BUILD
   --------------
   __fastcall TForm1::TForm1(TComponent* Owner)
           : TForm(Owner)
   {
      PageControl1->ActivePage = TabSheet1; // Secure to focus the first TabSheet
      TabSheet2->Visible = true;
      TabSheet2->Visible = false;
      TabSheet1->Visible = true;
   }


RESULTS:
--------
a) 'Button2' appeared on 'TabSheet1' !?
b) Adding 'TabSheet1->Visible = true;' back has not solved the problem
c) Adding 'TabSheet2->Visible = false;' solved the problem


What's wrong with all of that?

Vladimir.


8. Problems searching for text in files, and finding info... what's the deal? - C++ Builder IDE