eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'ImageView':

Home

everywhere
www.exept.de
for:
[back]

Class: ImageView


Inheritance:

   Object
   |
   +--GraphicsContext
      |
      +--DeviceGraphicsContext
         |
         +--GraphicsMedium
            |
            +--DisplaySurface
               |
               +--SimpleView
                  |
                  +--View
                     |
                     +--ImageView
                        |
                        +--ColorBulletIndicator
                        |
                        +--ImageEditView

Package:
stx:libwidg2
Category:
Views-Misc
Version:
rev: 1.73 date: 2010/03/04 23:32:28
user: cg
file: ImageView.st directory: libwidg2
module: stx stc-classLibrary: libwidg2
Author:
Claus Gittinger

Description:


This View knows how to display a (bitmap-)image (or form).

You can display an image with:

    ImageView openOn:anImageFileName
or:
    ImageView openOnImage:anImage
or:
    ImageView new image:anImage

i.e.

    ImageView openOn:'../../goodies/bitmaps/gifImages/garfield.gif'
    ImageView openOn:'../../goodies/bitmaps/SBrowser.xbm'

    ImageView openOnImage:(Image fromFile:'../../goodies/bitmaps/gifImages/garfield.gif')
    ImageView openOnImage:(Image fromFile:'../../goodies/bitmaps/SBrowser.xbm')

adjust:     
    controls how images are displayed;
    can be one of:
        #topLeft    - image is displayed as usual
        #center     - image is shown centered
        #fitBig     - big images are shrunk to make it fit the view
        #fitSmall   - small images are magnified to make it fit the view,
        #fit        - all images are magnified to fit the view


Related information:

    Image
    Form

Class protocol:

initialization
o  initialize

queries-plugin
o  aspectSelectors

startup
o  openOn: aFileName
startup an image viewer on an image read from a file

o  openOnImage: anImage
startup an image viewer on an image


Instance protocol:

accessing
o  adjust: layoutSymbol
set the adjust (how the image is displayed);
currently, only support #topLeft, #center, #fitBig, #fitSmall and #fit:
#topLeft - image is displayed as usual
#center - image is shown centered
#fitBig - big images are shrunk to make it fit the view
#fitSmall - small images are magnified to make it fit the view,
#fit - all images are magnified to fit the view

o  image
return the image

o  image: anImage
set the image

o  image: anImage scroll: doScroll
set the image - show a wait cursor, since image dithering may take a while

o  image: anImage scroll: doScroll invalidate: doInvalidate
set the image - show a wait cursor, since image dithering may take a while

o  magnification

o  setImage: anImage
set the image - show a wait cursor, since image dithering may take a while

o  setImage: anImage scroll: doScroll
set the image - show a wait cursor, since image dithering may take a while

o  setImage: anImage scroll: doScroll invalidate: doInvalidate
set the image - show a wait cursor, since image dithering may take a while

o  tileMode: aBoolean tileOffset: aPoint

accessing-channels
o  imageChannel

o  imageChannel: aValueHolder

change & update
o  update: something with: aParameter from: changedObject

o  updateFromModel
the model changes, set my image

drawing
o  generateMagnifiedImage

o  redrawX: x y: y width: w height: h

event handling
o  buttonMotion: state x: x y: y

o  buttonPress: button x: x y: y

o  buttonRelease: button x: x y: y

o  sizeChanged: how

initialization & release
o  destroy

queries
o  heightOfContents
return the images height - scrollbar needs this info

o  widthOfContents
return the images width - scrollbar needs this info

scrolling
o  scrollToMakeVisible: aPoint
try to arrange for aPoint to be visible (at the center, if possible)


Examples:


|top imgView scrView| top := StandardSystemView new. top extent:300@300. imgView := ImageView new. imgView image:(Image fromFile:'../../goodies/bitmaps/gifImages/garfield.gif'). scrView := HVScrollableView forView:imgView. scrView origin:0@0 corner:1.0@1.0. top add:scrView. top open.

ST/X 6.1.1; WebServer 1.620 at exept:8081; Mon, 21 May 2012 18:07:43 GMT