Programming magic, glory, and juices.

WebShot Higher Quality GIFs

December 31st, 2007


Recently I’ve been working on getting WebShot to produce high quality GIF images. GDI+ 1.0 uses a halftone palette. I’ve implemented color quantization which produces a better palette. You can compare the difference in the two images below. If you click on the images you can see the whole website in each of the palettes. I’ve also noticed a 20% reduction in the GIF file size, which most likely has to do with the way GDI+ saves images when converting from 24bbp to 8bpp versus native 8bpp.

GDI+ 1.0 (Halftone)

Custom (Color Quantization with Octree)

WebShot and Mozilla ActiveX Control

August 24th, 2007


I tried today to get WebShot working with the Mozilla ActiveX control. Unfortunately the ActiveX control is not a viable option for taking screenshots of web pages.

  • Querying IHTMLBodyElement for IHTMLElementRender does not work
  • Calling OleDraw does not work because the supported interface IViewObject is not implemented
  • Copying the Window’s device context does not work properly and sometimes it copies portions of the desktop

The Mozilla ActiveX control would be great if it were actively maintained and updated.