Forums

Welcome Guest Search | Active Topics | Members

Owner draw ListView Options
shelwig
Posted: Friday, March 28, 2008 3:53:17 AM
Rank: Member
Groups: Member

Joined: 2/24/2008
Posts: 10
Points: 30
I notice there is no ownerdraw property on the thumbnail listview control.

I need to display a list of jpeg files, as thumbnails and the thumbnail control is working beautifully - nice and fast and easy to use.

However I need to overlay the thumbnail with some small icons depending on certain attributes of those jpegs. Is this possible?
Alex Kon
Posted: Monday, March 31, 2008 1:51:13 AM
Rank: Advanced Member
Groups: Administration , Member

Joined: 1/31/2005
Posts: 376
Points: 373
Hello,

Unfortunately our control has no owner-draw mode. So the only way I can suggest is to draw necessary icons directly on the thumbnail. You may handle IconChanged event and modify thumbnails as you wish.

Here is small code sample to illustrate the idea:

Somewhere in initialization method:
Code:
_tl.Items.IconChanged += new
    Aurigma.GraphicsMill.WinControls.IconChangedEventHandler(Items_IconChanged);


And this is event handler implementation:
Code:

void Items_IconChanged(object sender,
    Aurigma.GraphicsMill.WinControls.IconChangedEventArgs e)
{
    if (e.View == Aurigma.GraphicsMill.WinControls.View.Thumbnails)
    {
        object itemImageKey = e.Item.GetIconKey(e.View);
        Aurigma.GraphicsMill.WinControls.IImageList thumbnailsList =
            _tl.GetImageList(e.View);

        Aurigma.GraphicsMill.Bitmap bmp =
            thumbnailsList.GetImage(itemImageKey);
        using (System.Drawing.Graphics g = bmp.GetGdiplusGraphics())
            g.FillRectangle(System.Drawing.Brushes.Red, 10, 10, 10, 10);

        thumbnailsList.SetImage(bmp, itemImageKey);
    }
}


Best wishes, Alex.
shelwig
Posted: Monday, March 31, 2008 2:28:29 AM
Rank: Member
Groups: Member

Joined: 2/24/2008
Posts: 10
Points: 30
Thanks for all your effort there Alex.

I'll give it a try and let you know how it goes.
Alex Kon
Posted: Monday, April 07, 2008 1:37:21 AM
Rank: Advanced Member
Groups: Administration , Member

Joined: 1/31/2005
Posts: 376
Points: 373
Hi,

Do you have any progress with the issue?


Best wishes, Alex.
shelwig
Posted: Thursday, April 10, 2008 4:11:35 AM
Rank: Member
Groups: Member

Joined: 2/24/2008
Posts: 10
Points: 30
Well...no.

I have decided to stick with the image list I had - adapted myself from a control on www.codeproject.com. It already does what I need and I have a deadline now.

Thankyou. Some time in the future I will try again with GraphicsMill Image List. I have purchase Graphicsmill anyway, as the IPTC and EXIF data editing functionality is great!

I am also using the Bitmap viewer.

Thanks again for your efforts.
shelwig
Posted: Thursday, April 24, 2008 10:19:32 PM
Rank: Member
Groups: Member

Joined: 2/24/2008
Posts: 10
Points: 30
Turns out I'll be revisiting this Painting issue in the next week or so. I'll let you know how I get on.
Alex Kon
Posted: Tuesday, April 29, 2008 7:41:01 AM
Rank: Advanced Member
Groups: Administration , Member

Joined: 1/31/2005
Posts: 376
Points: 373
OK, feel free to post here any thoughts or questions.

Best wishes, Alex.
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

YAFVision Theme Created by Jaben Cargman (Tiny Gecko)
Yet Another Forum.net version 1.9.1.6 running under Cuyahoga.
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.