|
Class: ImageView
Object
|
+--GraphicsMedium
|
+--DisplaySurface
|
+--SimpleView
|
+--View
|
+--ImageView
|
+--ColorBulletIndicator
|
+--GnuplotGraphView
|
+--ImageEditView
- Package:
- stx:libwidg2
- Category:
- Views-Misc
- Version:
- rev:
1.162
date: 2023/08/31 13:19:15
- user: cg
- file: ImageView.st directory: libwidg2
- module: stx stc-classLibrary: libwidg2
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
copyrightCOPYRIGHT (c) 1993 by Claus Gittinger
All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
inclusion of the above copyright notice. This software may not
be provided or otherwise made available to, or used by, any
other person. No title to or ownership of the software is
hereby transferred.
initialization
-
initialize
-
(comment from inherited method)
to get language changes
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
|
-
middleButtonMenuExtraSaveSlice
-
can be refdefined in subclasses to add more menu items
-
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
-
canScrollWithFourWayCursor: something
-
-
forceSmoothing
-
true if the image will be smoothed, when magnifying
-
forceSmoothing: aBoolean
-
set to true if the image shall be smoothed, when magnifying
-
forceSmoothingHolder
-
this holder controls if the image should be smoothed, when magnifying
-
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)
-
rotation
-
in degrees
-
rotation: degrees
-
in degrees
-
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
-
-
smoothDelayed
-
If on a slow machine, the UI is better if we first do a fast (but ugly)
magnify, followed by a slow smoothing in the background.
If the machine is fast, we should do smoothing and magnification in one
step. Set smoothDelayed to false for that.
-
smoothDelayed: aBoolean
-
If on a slow machine, the UI is better if we first do a fast (but ugly)
magnify, followed by a slow smoothing in the background.
If the machine is fast, we should do smoothing and magnification in one
step. Set smoothDelayed to false for that.
-
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
channels
-
magnificationFactorHolder
-
-
magnificationFactorHolder: aValueHolder
-
-
rotationHolder
-
-
rotationHolder: aValueHolder
-
drawing
-
generateMagnifiedImage
-
as of 2021-01 cannot magnify forms
-
generateRotatedImage
-
-
generateSmoothImage
-
-
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
-
indicate scroll operation ongoing via the 4-way cursor
-
buttonRelease: button x: x y: y
-
(comment from inherited method)
button was released - check my components for a hit.
-
imageChanged
-
flush the cacehd magnified image after a change of the image
-
mouseWheelZoom: amount
-
CTRL-wheel action
-
sizeChanged: how from: oldExtentOrNil
-
my view has changed the size (not the contents)
-
updateImageAfterSizeChange
-
self clear.
initialization & release
-
destroy
-
image := nil.
-
initialize
-
(comment from inherited method)
must be called if redefined
-
release
-
menu
-
editImage
-
popup menu item to open an image editor
-
fitBigMenuItemVisible
-
-
magnifyBy: scale
-
set again, so the menu shows nothing
-
middleButtonMenu
-
(comment from inherited method)
return the menu associated with the middle mouse button.
Here, return a hooked on menu, but usually redefined to provide a widget-specific
menu.
-
middleButtonMenuExtraSlice
-
-
saveImageAs
-
-
saveImageAs: filename
-
-
smoothFitBigMenuItemVisible
-
-
smoothingMenuItemVisible
-
-
zoomIn
-
popup menu item to zoom in (magnify more)
-
zoomOut
-
popup menu item to zoom out (magnify less)
queries
-
selfIsNotImageEditor
-
for the menu; to hide edit item
queries-contents
-
heightOfContents
-
return the image's height - scrollbar needs this info
-
widthOfContents
-
return the image's width - scrollbar needs this info
scrolling
-
canScrollWithFourWayCursor
-
-
scrollToMakeRectangleVisible: aRectangle
-
try to arrange for aRectangle to be visible (at the center, if possible)
Usage example(s):
|v|
v := ImageView new image:(Image fromFile:'../../goodies/bitmaps/gifImages/garfield.gif').
v openAndWaitUntilVisible.
v inspect.
v scrollToMakeRectangleVisible:((300@100) corner:(320@120)).
|
-
scrollToMakeVisible: aPoint
-
try to arrange for aPoint (in logical image coordinates)
to be visible (at the center, if possible)
Usage example(s):
|v|
v := ImageView new image:(Image fromFile:'../../goodies/bitmaps/gifImages/garfield.gif').
v openAndWaitUntilVisible.
v inspect.
v scrollToMakeVisible:(300@100).
|
|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.
|