Page 1 of 1

View PNG in a ListView

PostPosted: June 11th, 2006, 6:03 pm
by Codius
I really have no idea how to do this, I've managed to load pictures that I've added during designtime but that's it.
And I've been told I need to convert my PNG images to BMP before I can view them aswell?
I'm working on a "mapeditor" for a game and I'm pretty damn stuck to be honest.

I'd be greatful for an example, thanks in advance!

PostPosted: June 11th, 2006, 8:07 pm
by Johnny_Bit
it's so simple... get libpng for delphi and simply use it.

PostPosted: June 11th, 2006, 8:45 pm
by Codius
I do have png support, but I have no idea how to add images to the listview..

PostPosted: June 12th, 2006, 1:23 am
by kokkoras
Codius wrote:I do have png support, but I have no idea how to add images to the listview..


It must be something like this:

1. Set OwnerDraw property of listniew to true to allow the list view to receive the OnDrawItem event instead of the default rendering of list items.
2. Write code in an OnDrawItem handler to manually draw items in the list view.

Note that there are some more similar events available. Please check the events list of listview.