[webkit-dev] re ndering bitmaps

Christophe Gillette christophe.public at gmail.com
Wed Jul 8 09:30:38 PDT 2009


Hi Jack,

Example:
    PassRefPtr<SharedBuffer> fileContent =
SharedBuffer::createWithContentsOfFile(szFileName);
    if (!fileContent) {
        fprintf(stderr, "Could not load: %s\n", szFileName);
    } else {
        RefPtr<BitmapImage> image = BitmapImage::create();
        image->setData(fileContent, true);
        ctx.drawImage(image.get(), IntPoint(10, 10));
    }

If using gtk/cairo, the previous code can be prefixed by (if a graphics
context is not readily available):
    cairo_t* cr = gdk_cairo_create(GTK_WIDGET(widget)->window);
    GraphicsContext ctx(cr);
    cairo_destroy(cr);
    ctx.setGdkExposeEvent(event);

Regards,
Christophe


wootton wrote:
> 
> Hello,
> 
> Is there an API for rendering bitmaps using Webkit, so for example, if
> I wanted to render a bitmap image not currently defined in the HTML
> document's markup, can I do this?
> 
> -- 
> Regards
> Jack
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
> 
> 

-- 
View this message in context: http://www.nabble.com/rendering-bitmaps-tp24390627p24394711.html
Sent from the Webkit mailing list archive at Nabble.com.



More information about the webkit-dev mailing list