HOW TO: ListView & TreeView Bitmaps WITHOUT ImageList 
Author Message
 HOW TO: ListView & TreeView Bitmaps WITHOUT ImageList

Hi to all,
I'm stuck with a code problem: I need to implement graphics in controls like
ListView and TreeView, but I absolutely don't want to use the associated
ImageList control, because of its memory problems and instability. I
packaged a DLL containing all the bitmaps I need for my apps and I would
like to use them on demand (a huge load when the app starts fills up the
entire capacity of the ImageList).
Is there an API call or sort of to use bitmaps in ListView and TreeView from
DLL instead of using the associated ImageList, referring to them via index
number?
I tried several ways, but with no result.

Any help is really appreciated.
Thanks in advance.



Sun, 08 Feb 2004 20:46:08 GMT  
 HOW TO: ListView & TreeView Bitmaps WITHOUT ImageList
I've never had problems with the imagelist control (besides color depth)
but.. here's a couple places to go for info...

VBDirectoryTV: Make the TreeView into a DirListBox
"....It's simply a matter of telling the TreeView that it should get its
icon images not from a VB ImageList, but from the actual system imagelist
with the TVM_SETIMAGELIST treeview window message...."
http://www.mvps.org/btmtz/treeview/

SystemImagelist: How to associate the system imagelist with the VB ListView
http://www.mvps.org/btmtz/listview/

vbAccelerator Image List Control and Class v1.4
"Use COMCTL32.DLL directly to create an ImageList and take full control of
icons at all colour depths and sizes"
http://vbaccelerator.com/codelib/comctl/imglist.htm


Quote:
> Hi to all,
> I'm stuck with a code problem: I need to implement graphics in controls
like
> ListView and TreeView, but I absolutely don't want to use the associated
> ImageList control, because of its memory problems and instability. I
> packaged a DLL containing all the bitmaps I need for my apps and I would
> like to use them on demand (a huge load when the app starts fills up the
> entire capacity of the ImageList).
> Is there an API call or sort of to use bitmaps in ListView and TreeView
from
> DLL instead of using the associated ImageList, referring to them via index
> number?
> I tried several ways, but with no result.

> Any help is really appreciated.
> Thanks in advance.



Sun, 08 Feb 2004 22:12:16 GMT  
 HOW TO: ListView & TreeView Bitmaps WITHOUT ImageList
Thanks for the reply, I will check the links you reported and try to get my
problem solved.



Quote:
> I've never had problems with the imagelist control (besides color depth)
> but.. here's a couple places to go for info...

> VBDirectoryTV: Make the TreeView into a DirListBox
> "....It's simply a matter of telling the TreeView that it should get its
> icon images not from a VB ImageList, but from the actual system imagelist
> with the TVM_SETIMAGELIST treeview window message...."
> http://www.mvps.org/btmtz/treeview/

> SystemImagelist: How to associate the system imagelist with the VB
ListView
> http://www.mvps.org/btmtz/listview/

> vbAccelerator Image List Control and Class v1.4
> "Use COMCTL32.DLL directly to create an ImageList and take full control of
> icons at all colour depths and sizes"
> http://vbaccelerator.com/codelib/comctl/imglist.htm



> > Hi to all,
> > I'm stuck with a code problem: I need to implement graphics in controls
> like
> > ListView and TreeView, but I absolutely don't want to use the associated
> > ImageList control, because of its memory problems and instability. I
> > packaged a DLL containing all the bitmaps I need for my apps and I would
> > like to use them on demand (a huge load when the app starts fills up the
> > entire capacity of the ImageList).
> > Is there an API call or sort of to use bitmaps in ListView and TreeView
> from
> > DLL instead of using the associated ImageList, referring to them via
index
> > number?
> > I tried several ways, but with no result.

> > Any help is really appreciated.
> > Thanks in advance.



Mon, 09 Feb 2004 16:50:20 GMT  
 HOW TO: ListView & TreeView Bitmaps WITHOUT ImageList
The links you provided are really interesting, but I could not manage to use
my own bitmap DLL, instead of the SYSTEM imagelist; I cannot get the
TVM_SETIMAGELIST message to operate with my dll.

The matter is as follows:
Original project includes one form with one EMPTY ImageList control in it;
run-time procedure fills up the ImageList with bitmaps coming from a huge
DLL, via For Next cycle;

For i = 3 To cResource.LoadString(9000)
        Set img = imlBitmap16.ListImages.Add(i, , cResource.LoadBitmap(i))
Next

after that I have more than 500 images loaded and my EXE is OK in size,
which wouldn't occurr if I decided to store all the bitmaps design-time.
With this I can bind the ImageList to any ListView
cListView.SetHeaderColour ctl, True
ctl.ColumnHeaderIcons = frmBitmapForm.imlBitmap16

or TreeView,
ctl.ImageList = frmBitmapForm.imlBitmap16

or TabStrip in my project
ctl.ImageList = frmBitmapForm.imlBitmap16

But after this procedure I notice a VB memory overload message, when I try
to open a second copy of VB, or when I run another app, like Access.
So I thought about getting rid of the intrinsic ImageList to be bound to
useful controls like ListView and TreeView.
Wouldn't it be nice to use just one bitmap at a time (right the one you
need) and bind it to the control you need telling the Nodes.Add or
ListItems.Add procedures to use ID numbers from a DLL, instead of loading
all the bitmaps a project may require in an associated ImageList control?

Can u send example code of how you would achieve this?
Thank you in advance.



Quote:
> Thanks for the reply, I will check the links you reported and try to get
my
> problem solved.



> > I've never had problems with the imagelist control (besides color depth)
> > but.. here's a couple places to go for info...

> > VBDirectoryTV: Make the TreeView into a DirListBox
> > "....It's simply a matter of telling the TreeView that it should get its
> > icon images not from a VB ImageList, but from the actual system
imagelist
> > with the TVM_SETIMAGELIST treeview window message...."
> > http://www.mvps.org/btmtz/treeview/

> > SystemImagelist: How to associate the system imagelist with the VB
> ListView
> > http://www.mvps.org/btmtz/listview/

> > vbAccelerator Image List Control and Class v1.4
> > "Use COMCTL32.DLL directly to create an ImageList and take full control
of
> > icons at all colour depths and sizes"
> > http://vbaccelerator.com/codelib/comctl/imglist.htm



> > > Hi to all,
> > > I'm stuck with a code problem: I need to implement graphics in
controls
> > like
> > > ListView and TreeView, but I absolutely don't want to use the
associated
> > > ImageList control, because of its memory problems and instability. I
> > > packaged a DLL containing all the bitmaps I need for my apps and I
would
> > > like to use them on demand (a huge load when the app starts fills up
the
> > > entire capacity of the ImageList).
> > > Is there an API call or sort of to use bitmaps in ListView and
TreeView
> > from
> > > DLL instead of using the associated ImageList, referring to them via
> index
> > > number?
> > > I tried several ways, but with no result.

> > > Any help is really appreciated.
> > > Thanks in advance.



Mon, 09 Feb 2004 19:52:41 GMT  
 HOW TO: ListView & TreeView Bitmaps WITHOUT ImageList
The links you provided are really interesting, but I could not manage to use
my own bitmap DLL, instead of the SYSTEM imagelist; I cannot get the
TVM_SETIMAGELIST message to operate with my dll.

The matter is as follows:
Original project includes one form with one EMPTY ImageList control in it;
run-time procedure fills up the ImageList with bitmaps coming from a huge
DLL, via For Next cycle;

For i = 3 To cResource.LoadString(9000)
        Set img = imlBitmap16.ListImages.Add(i, , cResource.LoadBitmap(i))
Next

after that I have more than 500 images loaded and my EXE is OK in size,
which wouldn't occurr if I decided to store all the bitmaps design-time.
With this I can bind the ImageList to any ListView
cListView.SetHeaderColour ctl, True
ctl.ColumnHeaderIcons = frmBitmapForm.imlBitmap16

or TreeView,
ctl.ImageList = frmBitmapForm.imlBitmap16

or TabStrip in my project
ctl.ImageList = frmBitmapForm.imlBitmap16

But after this procedure I notice a VB memory overload message, when I try
to open a second copy of VB, or when I run another app, like Access.
So I thought about getting rid of the intrinsic ImageList to be bound to
useful controls like ListView and TreeView.
Wouldn't it be nice to use just one bitmap at a time (right the one you
need) and bind it to the control you need telling the Nodes.Add or
ListItems.Add procedures to use ID numbers from a DLL, instead of loading
all the bitmaps a project may require in an associated ImageList control?

Can u send example code of how you would achieve this?
Thank you in advance.



Quote:
> I've never had problems with the imagelist control (besides color depth)
> but.. here's a couple places to go for info...

> VBDirectoryTV: Make the TreeView into a DirListBox
> "....It's simply a matter of telling the TreeView that it should get its
> icon images not from a VB ImageList, but from the actual system imagelist
> with the TVM_SETIMAGELIST treeview window message...."
> http://www.mvps.org/btmtz/treeview/

> SystemImagelist: How to associate the system imagelist with the VB
ListView
> http://www.mvps.org/btmtz/listview/

> vbAccelerator Image List Control and Class v1.4
> "Use COMCTL32.DLL directly to create an ImageList and take full control of
> icons at all colour depths and sizes"
> http://vbaccelerator.com/codelib/comctl/imglist.htm



> > Hi to all,
> > I'm stuck with a code problem: I need to implement graphics in controls
> like
> > ListView and TreeView, but I absolutely don't want to use the associated
> > ImageList control, because of its memory problems and instability. I
> > packaged a DLL containing all the bitmaps I need for my apps and I would
> > like to use them on demand (a huge load when the app starts fills up the
> > entire capacity of the ImageList).
> > Is there an API call or sort of to use bitmaps in ListView and TreeView
> from
> > DLL instead of using the associated ImageList, referring to them via
index
> > number?
> > I tried several ways, but with no result.

> > Any help is really appreciated.
> > Thanks in advance.



Wed, 11 Feb 2004 01:12:08 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. HOW TO: ListView & TreeView Bitmaps WITHOUT ImageList

2. Imagelist, Treeview, Listview - 256 colour icons

3. TreeView/ListView bitmaps source?

4. TreeView & ImageList

5. Help with Treeview & Imagelist

6. ImageLists, TabStrips, TreeViews & MaskColours

7. Treeview & Imagelist question

8. TreeView & ImageList

9. VB4: ListView & ImageList

10. treeview & listview, slow directory listing

11. Treeview & Listview

12. Listview control & Treeview

 

 
Powered by phpBB® Forum Software