From 84600d6b9944edaa2717982c11da710a8d8ab9f3 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Sat, 5 Jul 2008 18:42:16 +0000 Subject: [PATCH] improved docs for overlay/xy a little svn: r10622 --- .../teachpack/htdp/scribblings/image.scrbl | 25 ++++++++++++++++--- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/collects/teachpack/htdp/scribblings/image.scrbl b/collects/teachpack/htdp/scribblings/image.scrbl index e77a753c3b..676fb62a9d 100644 --- a/collects/teachpack/htdp/scribblings/image.scrbl +++ b/collects/teachpack/htdp/scribblings/image.scrbl @@ -153,10 +153,27 @@ first image. @defproc[(overlay/xy [img image?] [delta-x number?] [delta-y number?] [other image?]) image?]{ Creates an image by adding the pixels of @scheme[other] to -@scheme[img]. Instead of lining up on the pinhole, @scheme[other]'s pinhole -is lined up with an offset of (@scheme[delta-x],@scheme[delta-y]) from the -pinhole of @scheme[img]. The pinhole of the resulting image is the same -place as the pinhole in the first image.} +@scheme[img]. + +Instead of lining the two images up on their pinholes, +@scheme[other]'s pinhole is lined up on the point: +@schemeblock[ +(make-posn (+ (pinhole-x img) delta-x) + (+ (pinhole-y img) delta-y)) +] + +The pinhole of the resulting image is the same +place as the pinhole in the first image. + +The same effect can be had by combining +@scheme[move-pinhole] and @scheme[overlay], +@schemeblock[ +(overlay img + (move-pinhole other + (- delta-x) + (- delta-y)))] + +} @defproc[(image-inside? [img image?] [other image?]) boolean?]{ Determines whether the pixels of the second image appear in the first.