View PNG in a ListView

Please discuss general Delphi programming topics here.

View PNG in a ListView

Postby Codius » June 11th, 2006, 6:03 pm

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!
I've never let my schooling interfere with my education.
Codius
Active Member
Active Member
 
Posts: 17
Joined: June 6th, 2006, 12:55 pm
Location: Sweden

Postby Johnny_Bit » June 11th, 2006, 8:07 pm

it's so simple... get libpng for delphi and simply use it.
Johnny_Bit
VIP Member
VIP Member
 
Posts: 455
Joined: June 15th, 2003, 9:56 am

Postby Codius » June 11th, 2006, 8:45 pm

I do have png support, but I have no idea how to add images to the listview..
I've never let my schooling interfere with my education.
Codius
Active Member
Active Member
 
Posts: 17
Joined: June 6th, 2006, 12:55 pm
Location: Sweden

Postby kokkoras » June 12th, 2006, 1:23 am

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.
Fotis
User avatar
kokkoras
Moderator
Moderator
 
Posts: 317
Joined: March 12th, 2005, 11:19 pm
Location: Thessaloniki, Greece


Return to Delphi Programming

Who is online

Users browsing this forum: No registered users and 6 guests

cron