TViewer
by
Yaroslav Novitsky - Sandman
Component: It is kind
of intelligent viewer. It means that you only give it a FileName
and it defines it type due to extention (one of the supported)
and shows it.
Supported file types: bmp, jpg, avi, ico, emf, wmf, wav, mid,
rmi, midi, mov, ani, gif, txt, rtf.
Demo: executable included.
Requires: RX Library.
Go: www.suicider.com
for new versions.
Main side of this component is that you don't have
to define a filetype by yourself, then create a resource for it
(TImage, TRichEidt, ...), then view it - you simply write Viewer.FileName:=MyFile;
TViewer is a descendent of TPanel - all
Panel Properties, Methods and Events avaliable. Plus some
TViewer's new Properties, Events and Methods:
Design-time properies:
- FileName: string - sets a filename
and it loads (no load method needed)
- Controller - defines a controller
options used for video and sound formats
- Visible: boolean - if
controler is visible
- Left, Top, Width, Height:
integer - position of controller (inside TViewer)
- VisibleButtons - set of
buttons to show
- EnabledButtons,
ColoredButtons - something not very needed :)
- Vieweport - defines a viewport
options for all graphical formats
- Stretch: boolean - if to
stretch graphics to sizes of viewport. If false
graphics will stay original size, but if they are
bigger than sizes of TViewer than they stretch PROPORTIONALLY
to fit TViewer.
- Left, Top, Width, Height:
integer - position of viewport (inside TViewer)
Run-time properties:
- ImageWidth: integer - width of
current graphics (If any. Check MediaType)
- ImageHeight: integer - height of
current graphics (If any. Check MediaType)
- MediaType - one of MTNone, MTImage,
MTAnimation, MTVideo, MTSound, MTText
- Picture: TImage, Media:
TMediaPlayer, Animate: TAnimatedImage, Gif:
TRXGifAnimator, Edit: TRXRichEdit - use for direct access
to viewing resources
Methods:
- HideAll - Hides all and everything.
Events:
- OnLoad - everytime new file loads
(not new filename set!)
- OnMediaTypeChange - every time
media type change also to/from MTNone
Contact me at:
Mail me sandman@lviv.gu.net - forever happy to see your notes
Visit SUICIDER's Official Web Site - all my products and components always newest
versions