graphics problem in cellbackgroundpaint

i am customizing listbox so i can change cell color and add icons as needed. i can change the cell using cellbackgroundpaint and fillrect, no problem. I can add an icon using cellbackgroundpaint and fillpolygon. works fine. what i can’t figure out how to do is change the cell color AND add the icon. how do i draw g.polygon on to a g.rect?

treat each cell of a listbox as its own GRAPHICS object… “g.drawpicture icon,0,0” etc.

g.forecolor=&c00ff00
g.fillrect 0,0,g.width,g.height
g.drawpicture icon,0,0

cool. how would i use the g.fillpolygon to create the icon? create as a picture with alpha or can i draw it on directly?

FillPolygon takes an array of integers to define the polygon that it draws. You can give it the points you need to draw your icon, or you can use a picture of the icon and use DrawPicture which might be easier. Sample from the docs:

Dim points() as Integer points=Array(0,10,5,40,40,5,60) g.FillPolygon points