Add instructions on how to take screen shots

This instructs the adventurer on how to take screen shots using the
same look and feel used to take the ones that can be found at
`collects/scribblings/gui/image'.

There are also two scripts that might help automate this process.
This commit is contained in:
Diogo F. S. Ramos 2012-09-04 18:17:11 -03:00 committed by Vincent St-Amour
parent 54ab1bfbfa
commit f147871728
3 changed files with 104 additions and 0 deletions

View File

@ -0,0 +1,38 @@
-*- org -*-
* Using GIMP
To take screen shots of the widgets, you can follow these steps:
1. Take a widget screen shot
2. Open it with GIMP
3. Cut it to 240 x 73
4. Add a border using Filters/Decor/Add Border...
+ Border X size :: 1
+ Border Y size :: 1
+ Border color :: black
+ Delta value on color :: 25
5. Combine all layers
6. Add a drop shadow using Filters/Light and Shadow/Drop
Shadow...
+ Offset X :: 8
+ Offset Y :: 8
+ Blur radius :: 9
+ Color :: black
+ Opacity :: 80
+ Allow resizing :: #t
7. Save as .png
There are two scripts in this directory that might help in this
process. Keep in mind though that the GIMP script is very fragile
and some tweaking might be necessary to make it work in different
setups.
+ [[file:widget.rkt][widget.rkt]] :: Creates a "canvas" panel with a border, so it is
easier to select the widget area using GIMP's Fuzzy
Select Tool
+ [[file:racket-widget.scm][racket-widget.scm]] :: GIMP's script which, when invoked, asks for a
window to take a screen shot and do the post production to the
image. This script should be put inside a specific directory,
here being `~/.gimp-2.6/scripts', and should be invoked at
File/Create/Racket Widget.

View File

@ -0,0 +1,48 @@
;;; -*- scheme -*-
(script-fu-register "script-fu-racket-widget"
"Racket Widget"
"Take a screen shot of a Racket Widget"
"Diogo F. S. Ramos"
"copyright 2012, Diogo F. S. Ramos"
"August, 2012"
"")
(script-fu-menu-register "script-fu-racket-widget" "<Image>/File/Create")
(define (script-fu-racket-widget)
(define (crop-to-selection selection image)
(let ((x1 (list-ref selection 0))
(y1 (list-ref selection 1))
(x2 (list-ref selection 2))
(y2 (list-ref selection 3)))
(gimp-image-crop image
(- x2 x1)
(- y2 y1)
x1 y1)))
(let ((image (car (plug-in-screenshot RUN-INTERACTIVE 0 0 0 0 0 0))))
(gimp-fuzzy-select (car (gimp-image-get-active-drawable image))
(/ (car (gimp-image-width image)) 2)
(/ (car (gimp-image-height image)) 2)
15.0
CHANNEL-OP-REPLACE
TRUE
FALSE
0.0
TRUE)
(gimp-selection-invert image)
(gimp-selection-shrink image 1.0)
(crop-to-selection (cdr (gimp-selection-bounds image)) image)
(script-fu-addborder image
(car (gimp-image-flatten image))
1.0
1.0
'(0 0 0)
25)
(script-fu-drop-shadow image
(car (gimp-image-flatten image))
8.0
8.0
9.0
'(0 0 0)
80.0
1)))

View File

@ -0,0 +1,18 @@
#lang racket/gui
(provide showcase)
(define showcase (lambda (#:hmult (hmult 1) . name)
(define frame (new frame% (label (if (null? name)
"widget"
(car name)))))
(define panel (new panel% (parent frame)))
(define showcase-panel (new horizontal-panel%
(parent panel)
(alignment '(center center))
(style '(border))
(min-width 242)
(min-height (* hmult 75))
(border 20)))
(send frame show #t)
showcase-panel))