|
superclass: snip% |
constructor
(make-object image-snip% [ file kind relative-path? inline? backing-scale]) → (is-a?/c image-snip%) file : (or/c path-string? input-port? #f) = #f
kind :
(or/c 'unknown 'unknown/mask 'unknown/alpha 'gif 'gif/mask 'gif/alpha 'jpeg 'png 'png/mask 'png/alpha 'xbm 'xpm 'bmp 'pict) = 'unknown relative-path? : any/c = #f inline? : any/c = #t backing-scale : (>/c 0.0) = 1.0 (make-object image-snip% bitmap [mask]) → (is-a?/c image-snip%) bitmap : (is-a?/c bitmap%) mask : (or/c (is-a?/c bitmap%) #f) = #f
Changed in version 1.1 of package snip-lib: Added the backing-scale argument.
method
(send an-image-snip equal-hash-code-of hash-code)
→ exact-integer? hash-code : (any/c . -> . exact-integer?)
See also equal<%>.
method
(send an-image-snip equal-secondary-hash-code-of hash-code)
→ exact-integer? hash-code : (any/c . -> . exact-integer?)
See also equal<%>.
method
(send an-image-snip get-bitmap) → (or/c (is-a?/c bitmap%) #f)
method
(send an-image-snip get-bitmap-mask)
→ (or/c (is-a?/c bitmap%) #f)
method
(send an-image-snip get-filename [relative-path])
→ (or/c path-string? #f) relative-path : (or/c (box/c any/c) #f) = #f
The relative-path box is filled with #t if the loaded file’s path is relative to the owning editor’s path, unless relative-path is #f.
method
(send an-image-snip get-filetype)
→
(or/c 'unknown 'unknown/mask 'unknown/alpha 'gif 'gif/mask 'gif/alpha 'jpeg 'png 'png/mask 'png/alpha 'xbm 'xpm 'bmp 'pict)
method
(send an-image-snip load-file file [ kind relative-path? inline? backing-scale]) → void? file : (or/c path-string? input-port? #f)
kind :
(or/c 'unknown 'unknown/mask 'unknown/alpha 'gif 'gif/mask 'gif/alpha 'jpeg 'png 'png/mask 'png/alpha 'xbm 'xpm 'bmp 'pict) = 'unknown relative-path? : any/c = #f inline? : any/c = #t backing-scale : (>/c 0.0) = 1.0
When 'unknown/mask, 'gif/mask, or 'png/mask is specified and the loaded bitmap object includes a mask (see get-loaded-mask), the mask is used for drawing the bitmap (see draw-bitmap). The 'unknown/alpha, 'gif/alpha, or 'png/alpha variants are recommended, however.
If relative-path? is not #f and file is a relative path, then the file will be read using the path of the owning editor’s filename. If the image is not inlined, it will be saved as a relative pathname.
If inline? is not #f, the image data will be saved directly to the file or clipboard when the image is saved or copied (preserving the bitmap’s mask, if any). The source filename and kind is no longer relevant.
Changed in version 1.1 of package snip-lib: Added the backing-scale argument.
method
(send an-image-snip other-equal-to? snip equal?) → boolean? snip : (is-a?/c snip%) equal? : (any/c any/c . -> . boolean?)
The given equal? function (for recursive comparisons) is not used.
method
(send an-image-snip set-bitmap bm [mask]) → void?
bm : (is-a?/c bitmap%) mask : (or/c (is-a?/c bitmap%) #f) = #f
An optional mask is used when drawing the bitmap (see draw-bitmap), but supplying the mask directly is deprecated. If no mask is supplied but the bitmap’s get-loaded-mask method produces a bitmap of the same dimensions, it is used as the mask; furthermore, such a mask is saved with the snip when it is saved to a file or copied (whereas a directly supplied mask is not saved). Typically, however, bm instead should have an alpha channel instead of a separate mask bitmap.
method
(send an-image-snip set-offset dx dy) → void?
dx : real? dy : real?