TImageList/ TCustomListbox problems
I'm hoping someone can help me with this, as I've been stumped by it
for 3 days. Here's what I am trying to do:
I have a Paradox table that contains a BLOB Field which is used to
store a bitmap. There is also a text field. I write all of the
graphics to an ImageList, and all the text to a StringList. Then I use
Stream.WriteComponent to write the ImageList to a TMemoryStream and
send this stream. On the client end, I use the following code in the
Client.OnProcess event to try and get the imagelist off the stream,
and the images off the imagelist (the TextRepList is used for the text
field) :
Stream.ReadComponent( femoticonList )
pic := TBitmap.Create();
textRepList := TStringList.Create();
Stream.Read( numEmots, sizeOf( numEmots ) );
textRepList.LoadFromStream( Stream );
for count := 0 to (numEmots-1) do
begin
femoticonList.GetBitmap( count, pic );
StringVal := textRepList.Strings[count];
lbEmots.Items.AddObject( StringVal, pic );
My listbox is of type OwnerDrawFixed and I use the ListBox.DrawItem
event to draw the listbox. The problem is: Only the last image in the
table is being drawn (the correct # of times, beside each text line).
The text works fine. Any ideas anyone? Any help would be greatly
appreciated! Thanks.