Image width limit for ListBox RowPicture images?

  1. 4 months ago

    Tim J

    Feb 7 Pre-Release Testers, Xojo Pro Dehydrating in AZ

    I've just noticed that my RowPicture images above 22x22 are starting to clip on the left edge of the listbox. Is there a width limit that we should be aware of when assigning a RowPicture?

  2. Emile S

    Feb 7 Europe (France, Strasbourg)

    CellWidth ?

  3. Jeff T

    Feb 7 Pre-Release Testers Midlands of England, Europe

    Pretty sure 16 x 16 is the biggest safe size.
    I usually drawpicture in the cellbackgroundpaint event instead.
    Adding the 'icon' to the rowtag is as easy as assigning a rowpicture

    list.additem  "hello"
    list.rowtag(list.lastindex) = myicon

    ..then in the cellbackgroundpaint, assuming a square icon

    dim p as picture
    if col = 0 then
    p = me.rowtag(row)
    g.drawpicture  p, 1,1, g.height -2 ,g.height -2 ,0,0, p. width, p.height
    end if
  4. 3 months ago

    Tim J

    Feb 8 Pre-Release Testers, Xojo Pro Dehydrating in AZ

    @Jeff T Pretty sure 16 x 16 is the biggest safe size.

    What I've uncovered as of last night. It just looks odd when I'm using tall rows to support touch screens. Looks like the CellBackgroundPaint is the only way to sort this. I'll have to also update the ColumnAlignmentOffset so the text is drawn properly offset.

  5. Jean-Yves P

    Feb 8 Pre-Release Testers, Xojo Pro Europe (France, Besançon)

    isn't the max picture width equal to the rowheight of the listbox ?

  6. Tim J

    Feb 8 Pre-Release Testers, Xojo Pro Dehydrating in AZ

    @Jean-YvesPochez isn't the max picture width equal to the rowheight of the listbox ?

    That is what I had Assumed, but apparently not.

  7. Dave S

    Feb 8 San Diego, California USA

    @Tim J What I've uncovered as of last night. It just looks odd when I'm using tall rows to support touch screens. Looks like the CellBackgroundPaint is the only way to sort this. I'll have to also update the ColumnAlignmentOffset so the text is drawn properly offset.

    What I have done is just forego CellTextPaint (return true), and do all the drawing (icons, text etc) in CellBackgroundPaint
    this way you have full control .. icons positioned where you want, the size you want.... multiple lines of text, different colors etc.

  8. Tim J

    Feb 8 Pre-Release Testers, Xojo Pro Dehydrating in AZ

    @Dave S What I have done is just forego CellTextPaint (return true), and do all the drawing (icons, text etc) in CellBackgroundPaint
    this way you have full control .. icons positioned where you want, the size you want.... multiple lines of text, different colors etc.

    That works, but I'm also trying to let the automatic handling of dark versus light modes do their thing.

  9. Jason P

    Feb 8 Xojo Inc Texas

    I don't think it's documented anywhere but 20 x 20 seems to be about the maximum size you should use before you start to get clipping on the left.

or Sign Up to reply!