Listview problem 
Author Message
 Listview problem

I have problem setting images to the listview child header control
specifying LVCF_IMAGE column style. Images are set but their background
is not transparent despite images from the same list set for listview
item are draw normally. I also tried to set imagelist and image directly
to header control specifying HDI_IMAGE for HDITEM mask field and
HDF_IMAGE for fmt field and but result is the same: images drawn on
header control items do not have transparent background.

Any help would be greatly appreciated.



Sat, 22 Jun 2002 03:00:00 GMT  
 Listview problem
When you created the imagelist, did you use a mask?
Quote:

> I have problem setting images to the listview child header control
> specifying LVCF_IMAGE column style. Images are set but their background
> is not transparent despite images from the same list set for listview
> item are draw normally. I also tried to set imagelist and image directly
> to header control specifying HDI_IMAGE for HDITEM mask field and
> HDF_IMAGE for fmt field and but result is the same: images drawn on
> header control items do not have transparent background.

> Any help would be greatly appreciated.



Sun, 23 Jun 2002 03:00:00 GMT  
 Listview problem
On Tue, 04 Jan 2000 22:48:39 -0500, Alexander Galkin

Quote:

>I have problem setting images to the listview child header control
>specifying LVCF_IMAGE column style. Images are set but their background
>is not transparent despite images from the same list set for listview
>item are draw normally. I also tried to set imagelist and image directly
>to header control specifying HDI_IMAGE for HDITEM mask field and
>HDF_IMAGE for fmt field and but result is the same: images drawn on
>header control items do not have transparent background.

Yeah, this is a problem with the header control.  I overcame it by
deriving my own CMyHeaderCtrl and making the items that contain images
owner-drawn (see  example of this).  I adapted the code from Zafir
Anjum's article on transparent bitmaps to draw the bitmap's background
transparently.

If you can wait a few days, I can create a generic version of my code
and send it to you.  If not, check out the articles in the footnotes
below.

[1] See http://www.codeguru.com/listview/indicating_sort_order.shtml
for an example of using your own header control and doing custom
drawing on it.

[2] http://www.codeguru.com/bitmap/transparent_bitmap.shtml

--
Chip
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
"Make it idiot-proof and someone will make a better idiot."
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-



Sun, 23 Jun 2002 03:00:00 GMT  
 Listview problem
I would be very grateful to you if you did this. But please don't use
MFC, I do not use MFC and I need owner draw header control without MFC.
I indeed use ATL so you can take advantage of ATL message maps and
derived your owner draw header class from CContainedWindow. Then I can
subclass child header in listview using your class.

Yours,
Alexander Galkin

Quote:

> On Tue, 04 Jan 2000 22:48:39 -0500, Alexander Galkin

> >I have problem setting images to the listview child header control
> >specifying LVCF_IMAGE column style. Images are set but their
> background
> >is not transparent despite images from the same list set for listview

> >item are draw normally. I also tried to set imagelist and image
> directly
> >to header control specifying HDI_IMAGE for HDITEM mask field and
> >HDF_IMAGE for fmt field and but result is the same: images drawn on
> >header control items do not have transparent background.

> Yeah, this is a problem with the header control.  I overcame it by
> deriving my own CMyHeaderCtrl and making the items that contain images

> owner-drawn (see  example of this).  I adapted the code from Zafir
> Anjum's article on transparent bitmaps to draw the bitmap's background

> transparently.

> If you can wait a few days, I can create a generic version of my code
> and send it to you.  If not, check out the articles in the footnotes
> below.

> [1] See http://www.codeguru.com/listview/indicating_sort_order.shtml
> for an example of using your own header control and doing custom
> drawing on it.

> [2] http://www.codeguru.com/bitmap/transparent_bitmap.shtml

> --
> Chip
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> "Make it idiot-proof and someone will make a better idiot."
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-



Mon, 24 Jun 2002 03:00:00 GMT  
 Listview problem
I would very very grateful to you if you did this. But please don't use
MFC, I do not use MFC and I need owner draw header control without MFC.
I indeed use ATL so you can take advantage of ATL message maps and
derived your owner draw header class from CContainedWindow. Then I can
subclass child header in listview using your class.

Yours,
Alexander Galkin

Quote:

> On Tue, 04 Jan 2000 22:48:39 -0500, Alexander Galkin

> >I have problem setting images to the listview child header control
> >specifying LVCF_IMAGE column style. Images are set but their
> background
> >is not transparent despite images from the same list set for listview

> >item are draw normally. I also tried to set imagelist and image
> directly
> >to header control specifying HDI_IMAGE for HDITEM mask field and
> >HDF_IMAGE for fmt field and but result is the same: images drawn on
> >header control items do not have transparent background.

> Yeah, this is a problem with the header control.  I overcame it by
> deriving my own CMyHeaderCtrl and making the items that contain images

> owner-drawn (see  example of this).  I adapted the code from Zafir
> Anjum's article on transparent bitmaps to draw the bitmap's background

> transparently.

> If you can wait a few days, I can create a generic version of my code
> and send it to you.  If not, check out the articles in the footnotes
> below.

> [1] See http://www.codeguru.com/listview/indicating_sort_order.shtml
> for an example of using your own header control and doing custom
> drawing on it.

> [2] http://www.codeguru.com/bitmap/transparent_bitmap.shtml

> --
> Chip
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> "Make it idiot-proof and someone will make a better idiot."
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-



Mon, 24 Jun 2002 03:00:00 GMT  
 Listview problem

Quote:

>I would be very grateful to you if you did this. But please don't use
>MFC, I do not use MFC and I need owner draw header control without MFC.

Forgive the question, but WHY did you post to the ".mfc" newsgroup if you're
not using MFC??????

Chris
-----------------------------------------------------------------------

Visit our web site at http://www.skymap.com
Astronomy software written by astronomers, for astronomers



Mon, 24 Jun 2002 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Windows Form ListView problem

2. Listview problems

3. ListView-Problem in conjunction with COM

4. REALLY annoying listview problem

5. REALLY annoying listview problem

6. ListView Problem!!(Right button popup menu)

7. ListView Problem.

8. ListView problems: Displaying a button in a column

9. Listview problems : Handling LVN_ITEMCHANGING

10. Listview problems:how do i display a button on the listcontrol

11. CustomDraw in ListView problem

12. CustomDraw service in ListViews Problem

 

 
Powered by phpBB® Forum Software