Re: [webkit-help] Webpage thumbnails
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. Jerry, I'm using r71 of the Chromium Embedded Framework, available here: http://code.google.com/p/chromiumembedded/ I'm having pretty good luck with it so far, although I've had to make some minor additions to it to support everything I need in my application. Emerick ___ webkit-help mailing list webkit-help@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-help
Re: [webkit-help] Webpage thumbnails
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@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-help ___ webkit-help mailing list webkit-help@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-help
Re: [webkit-help] Webpage thumbnails
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. I believe this is because you use the size of the frame's view, which is 800x800. Maybe use the web page directly? I'm not familiar with Chromium WebKit API so I have no idea if this would work or not. 2 - The image quality is really low. Barely legible, in fact. Try to use draw filter for Skia. Check the class SkDrawFilter or even better SkPaintFlagsDrawFilter. Or even, downscale it yourself with linear interpolation. Some related links: http://ariya.blogspot.com/2008/07/be-my-mirror-my-sword-and-shield.html http://ariya.blogspot.com/2008/08/seas-would-rise-when-i-gave-words.html http://labs.qt.nokia.com/blogs/2009/01/26/creating-thumbnail-preview/ http://labs.qt.nokia.com/blogs/2009/01/15/capturing-web-pages/ -- Ariya Hidayat http://www.linkedin.com/in/ariyahidayat ___ webkit-help mailing list webkit-help@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-help