[webkit-dev] How can I get the Image object from the StyleImage object
hyatt at apple.com
Mon Mar 22 12:54:59 PDT 2010
Images can either be bitmap images (GIF/JPG/PNG, etc.) or generated images that care about a size (gradient, SVG). So the answer really depends on your purpose. If you are just worried about bitmap images, then the passed in size doesn't really matter. Otherwise the correct size to use would depend on context, e.g., how was it being painted (as a background, a border, a list bullet, etc.)
On Mar 21, 2010, at 8:51 PM, hap 497 wrote:
> I would like to know how can I get the ImageObject(the one which
> passes for painting) from a StyleImage object?
> I am able to get the StyleImage of my element using:
> RenderObject *o = element->renderer();
> RenderStyle* style = o->style();
> StyleImage* bgImage = style->backgroundImage();
> My question is how can I get the Image being painted (the one which is
> actual pass to Graphics Context)?
> I see this method in StyleImage, but how can I use that? How can I
> find out the IntSize which is used for painting?
> virtual Image* image(RenderObject*, const IntSize&) const = 0;
> Thank you for your help.
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
More information about the webkit-dev