|
Class: ImageView
Object
|
+--GraphicsMedium
|
+--DisplaySurface
|
+--SimpleView
|
+--View
|
+--ImageView
|
+--ColorBulletIndicator
|
+--GnuplotGraphView
|
+--ImageEditView
- Package:
- stx:libwidg2
- Category:
- Views-Misc
- Version:
- rev:
1.134
date: 2019/03/06 13:14:14
- user: cg
- file: ImageView.st directory: libwidg2
- module: stx stc-classLibrary: libwidg2
- Author:
- Claus Gittinger
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
Image
Form
initialization
-
initialize
-
menu specs
-
middleButtonMenu
-
This resource specification was automatically generated
by the MenuEditor of ST/X.
usage example(s):
MenuEditor new openOnClass:ImageView andSelector:#middleButtonMenu
(Menu new fromLiteralArrayEncoding:(ImageView middleButtonMenu)) startUp
|
-
middleButtonMenuExtraSlice
-
can be refdefined in subclasses to add more menu items
queries-plugin
-
aspectSelectors
-
startup
-
openOn: anImageOrFileName
-
startup an image viewer on an image or
an image read from a file.
Return the imageView (not the topView)
usage example(s):
ImageView openOn:'bitmaps/gifImages/garfield.gif'
ImageView openOn:'bitmaps/xpmBitmaps/misc_icons/BOOK.xpm'
|
-
openOnFile: aFileName
-
startup an image viewer on an image read from a file.
Return the imageView (not the topView)
usage example(s):
ImageView openOnFile:'../../goodies/bitmaps/gifImages/garfield.gif'
ImageView openOnFile:'../../goodies/bitmaps/xpmBitmaps/misc_icons/BOOK.xpm'
|
-
openOnImage: anImage
-
startup an image viewer on an image.
Return the imageView (not the topView)
usage example(s):
ImageView openOnImage:(Image fromFile:'bitmaps/gifImages/garfield.gif') title:'garfield'
ImageView openOnImage:(Image fromFile:'../../libtool/bitmaps/SBrowser.xbm') title:'old browser icon'
|
-
openOnImage: anImage title: aString
-
startup an image viewer on an image.
Return the imageView (not the topView)
usage example(s):
ImageView openOnImage:(Image fromFile:'../../goodies/bitmaps/gifImages/garfield.gif') title:'garfield'
ImageView openOnImage:(Image fromFile:'../../libtool/bitmaps/SBrowser.xbm')
|
accessing
-
adjust
-
get the adjust (how the image is displayed);
currently, 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
#smoothFitBig - fitBig with smoothing
#smoothFitSmall - fitSmall with smoothing
#smoothFit - fit with smoothing
-
adjust: layoutSymbol
-
set the adjust (how the image is displayed);
currently, 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
#topLeftNoZoom - image is displayed as usual, and magnification is reset
#smoothFitBig - fitBig with smoothing
#smoothFitSmall - fitSmall with smoothing
#smoothFit - fit with smoothing
-
adjustHolder
-
get a valeHolder for the adjust (how the image is displayed);
currently, 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
#smoothFitBig - fitBig with smoothing
#smoothFitSmall - fitSmall with smoothing
#smoothFit - fit with smoothing
-
forceSmoothing
-
-
forceSmoothing: aBoolean
-
-
forceSmoothingHolder
-
-
image
-
return the image
-
image: anImage
-
set the image scrolls as set by adjust
- may show a wait cursor, if image dithering may take a while
-
image: anImage scroll: doScroll
-
set the image possibly scroll as set by adjust
- may show a wait cursor, if image dithering may take a while
-
image: anImage scroll: doScroll invalidate: doInvalidate
-
set the image possibly scroll as set by adjust
- may show a wait cursor, if image dithering may take a while
-
imageEditAction: aOneArgBlockOrNil
-
if nonNil, aOneArgBlockOrNil will be called to open
the image editor (as by the 'Edit Image' menu action).
If never set, the default ImageEditor is opened.
-
magnification
-
-
magnificationFactor
-
-
magnificationFactor: aNumber
-
explicitMagnificationFactor ~= aNumber
-
model: aValueHolder
-
(comment from inherited method)
Set the model.
Here, if I am my own menuPerformer/menuHolder,
set the menuHolder and menuPerformer to the model.
This is a compatibility kludge,
since typically, ST-80 code expects the model to provide a menu
and perform it. If the model does not support a menu message,
it will be forwarded to the view.
Those apps which want the view to provide the (default) menu have to reset
this by sending #menuHolder: message (again)
-
setImage: anImage
-
set the image - show a wait cursor, since image dithering may take a while
-
setImage: anImage scroll: doScroll
-
set the image - may show a wait cursor, if image dithering may take a while
-
setImage: anImage scroll: doScroll invalidate: doInvalidate
-
set the image - may show a wait cursor, if image dithering may take a while
-
sizeToFit: aBoolean
-
-
tileMode: aBoolean tileOffset: aPoint
-
accessing-channels
-
imageChannel
-
-
imageChannel: aValueHolder
-
-
mousePointHolder
-
change & update
-
update: something with: aParameter from: changedObject
-
-
updateFromModel
-
the model changes, set my image
drawing
-
generateMagnifiedImage
-
smooth
-
redrawX: x y: y width: w height: h
-
rectRight rectBelow
event handling
-
buttonMotion: state x: x y: y
-
lastMousePoint value:mousePoint.
-
buttonPress: button x: x y: y
-
self cursor:(Cursor handGrab).
-
buttonRelease: button x: x y: y
-
(comment from inherited method)
button was released - check my components for a hit.
-
mouseWheelZoom: amount
-
CTRL-wheel action
-
sizeChanged: how
-
(comment from inherited method)
tell subviews that I changed size.
How is either #smaller, #larger or nil, and is used to control the order,
in which subviews are notified (possibly reducing redraw activity)
-
updateImageAfterSizeChange
-
self clear.
initialization & release
-
destroy
-
image := nil.
-
initialize
-
(comment from inherited method)
must be called if redefined
menu
-
editImage
-
-
fitBigMenuItemVisible
-
-
magnifyBy: scale
-
set again, so the menu shows nothing
-
middleButtonMenu
-
-
middleButtonMenuExtraSlice
-
-
saveImageAs
-
-
saveImageAs: filename
-
-
smoothFitBigMenuItemVisible
-
-
smoothingMenuItemVisible
-
queries
-
heightOfContents
-
return the image's height - scrollbar needs this info
-
selfIsNotImageEditor
-
for the menu; to hide edit item
-
widthOfContents
-
return the image's width - scrollbar needs this info
scrolling
-
scrollToMakeRectangleVisible: aRectangle
-
try to arrange for aRectangle to be visible (at the center, if possible)
-
scrollToMakeVisible: aPoint
-
try to arrange for aPoint (in logical image coordinates)
to be visible (at the center, if possible)
|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.
|