[webkit-help] Webpage thumbnails

Jerry Evans jerry at NovaDSP.com
Fri Apr 2 08:02:49 PDT 2010


Hello Emerick

Might I ask how you configured the Chromium build and how it is 
embedded? I'm trying to put together a definitive embedding Webkit for 
Windows Wiki or similar.

Thx++

On 02/04/2010 15:08, Emerick Rogul wrote:
> Hi everyone,
>
> I'm using the Chromium port of WebKit in my Windows application.  I'm
> working on a component that will produce a reduced-scale thumbnail of
> the current web page.  I can't seem to get the rendered image to scale
> properly using Skia and I'm not sure what I'm doing wrong.
>
> Here's what I'm attempting:
>
> WebKit::WebSize webSize = frame->view()->size();
>
> // Create the canvas and scale it down 50%
> skia::VectorCanvas canvas(hdc, webSize.width, webSize.height);
> canvas.drawARGB(255, 255, 255, 255, SkXfermode::kSrc_Mode);
> canvas.scale(SkScalar(0.50), SkScalar(0.50));
>
> // Paint the view into the canvas
> WebKit::WebRect rect(0, 0, webSize.width, webSize.height);
> frame->view()->layout();
> frame->view()->paint(&canvas, rect);
>
> This results in an image, but it has two problems:
>
> 1 - It's just a small portion of the webpage.  Specifically, if my HDC
> contains a 800x800 bitmap, then this will only return an 800x800
> portion of the webpage.  What I want is *all* of the webpage, scaled
> to fit into an 800x800 (in this example) bitmap.
>
> 2 - The image quality is really low.  Barely legible, in fact.
>
> I'm pretty sure I'm doing something wrong here or missing something
> basic.  Could anyone give me a good shove in the right direction?
>
> Thanks,
>
> Emerick
> _______________________________________________
> webkit-help mailing list
> webkit-help at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-help
>
>    
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-help/attachments/20100402/b77e8153/attachment.html>


More information about the webkit-help mailing list