Friday, 7 November 2014

Simple Image Viewer

The script shows some techniques in drawing an image using Cairo. The image can be resized and repositioned by using mouse scroll and mouse drag.


  1. Inherit a new class PageFrame from GTK.DrawingArea.
  2. Define pixbuf in PageFrame for holding image for display.
  3. Define mouse scroll handler in PageFrame for resizing image.
  4. Define mouse drag handler in PageFrame for repositioning image.
  5. During resizing, the location of the mouse pointer will be the centre of the transformation.

Source Code


No comments:

Post a Comment