PicShow
Family Components v3.08
|
Copyright ©
Kambiz R. Khojasteh. All rights reserved.
Get future component updates from http://www.delphiarea.com.
Delphi
3 |
Delphi
4 |
Delphi
5 |
Delphi
6 |
Delphi
7 |
DESCRIPTION
TPicShow is an
image slider control with 150 transitional effects in pure Delphi code. The
major characteristics of TPicShow are:
- Image transition
can be controlled programmatically
- Image can
be stretched or centered in the client area of the control
- Control can
show a background image as centered, stretched, or tiled
- Transition
process can use a separated thread
- New transitional
effects can be easily implemented and added to the control
TDBPicShow is
the data-aware version of TPicShow with ability to load bitmap, jpeg, and
metafile images (natively) from a blob field.
IMPORTANT
NOTE FOR DELPHI 3.0 USERS: Two procedures in 'Graphics.pas'
are missing a call to 'BitmapCanvasList.UnlockList'.
This bug will cause VCL graphics functions, which have not been called from
the main thread, to hang. They cannot lock 'BitmapCanvasList' because the
main thread never unlocks it. Because of this bug, running PicShow in threaded
mode will lead your application to deadlock. For the bug's details and fix
please visit: http://www.dataweb.nl/~r.p.sterkenburg/generated/entry0016.htm.
HO TO INSTALL
Add the following
component's units into a new or existing package:
- PicShow.pas
- PSEffect.pas
- PSReg.pas
(for design-time package only)
The following
packages must be added to the requires clause of your package:
- VCL
- VCLDB
- VCLJPG
- RTL (for
Delphi 6 or higher only)
- DBRTL (for
Delphi 6 or higher only)
- DesignIDE
(for design-time package, and Delphi 6 or higher only)
KEY PROPERTIES
- AutoDisplay:
Boolean (TDBPicShow only)
Determines whether the control automatically displays the contents of
a graphic BLOB in the database control.
- AutoSize:
Boolean
If set to true, Automatically sizes the control to the size of the loaded
image if any is loaded.
- BgMode: TBackgroundMode
TBackgroundMode = (bmNone, bmTiled, bmStretched, bmCentered)
Determines how the control displays the background image on its client
area.
bmNone |
|
Ignores
the background image. |
bmTiled |
|
Fills
the client area of the control by the background image as tiled. |
bmStretched |
|
Fills
the client area of the control by stretching (or shrinking) the background
image. |
bmCentered |
|
Draws
the background image on the center of the control's client area. |
- BgPicture:
TPicture
Contains the background image of the control.
- Busy: Boolean
(Read-only)
Determines whether the control is performing an image transition.
- Center: Boolean
If set to true and control's client area is larger than the loaded image,
the image will be centered within the control's boundaries.
- Color: TColor
Determines the background color of the control.
- DataField:
String (TDBPicShow only)
Specifies the field of dataset, which contains the image data.
- DataSource:
TDataSource (TDBPicShow only)
Links the control to a dataset.
- Delay: Word
Determines the amount of delay in milliseconds before showing the next
frame of the transition.
- Empty : Boolean
(Read-only)
Determines whether any image is loaded into the control.
- Manual: Boolean
Determines whether the transition will be advanced manually. When this property
is true, the control does not advance the transition automatically and setting
the value of the Progress property will define the current frame of
the transition. When this property is false, the control automatically advances
the transition.
- OverDraw:
Boolean
Determines whether the control draws a new transition on the last ones. When
this property is True, the control draws the new transition over the last
one, otherwise before starting a new transition it clears the screen to the
background.
- Picture:
TPicture (Published in TPicShow only)
Contains the image that the next call to Execute will show it.
- Progress:
TPercent
TPercent = 0..100
Determines the current state of the running transition. When Busy
property is false, changing this property has no effect.
- Reverse:
Boolean
If set to true, automatic transitions plays in reverse.
- Stretch:
Boolean
If set to true, when the control's client area is larger than the loaded
image, the image it will be stretched (or shrinked) to fit within the control's
boundaries.
- StretchFine:
Boolean
Determines the behavior of the Stretch property. If set to true,
the image's aspect ratio remains unchanged.
- Step: Word
Determines the amount of change in Progress in automatic transition.
- Style: TShowStyle
TShowStyle = 0..127
Specifies the index of the transition effect that will be used. By setting
this property to zero, an OnCustomDraw event will be fired just before
showing a new frame.
- StyleName:
String
Specifies the name of the transition effect that will be used.
- Threaded:
Boolean
If set to true, the control use a separated thread for the transition
process.
- ThreadPriority:
TThreadPriority
TThreadPriority = (tpIdle, tpLowest, tpLower, tpNormal, tpHigher, tpHighest,
tpTimeCritical)
Determines the thread's scheduling priority relative to other threads
in the process.
KEY METHODS
- procedure
Execute
Initials the transition and if Manual property is set false, starts
it. If Manual property is set to true, after calling this method you
can change the value of Progress property.
- procedure
Clear
Clears the client area of the control. Notice that calling this method
does not clear the image loaded into Picture property.
- procedure
Stop
Stops the running transition.
KEY EVENTS
- OnAfterNewFrame:
TCustomDrawEvent
TCustomDrawEvent = procedure(Sender: TObject; Picture, Screen: TBitmap) of
object
This event is triggered just after creating a new
frame of the transition and before drawing it on the control's client area.
The Picture parameter is the original image and the Screen parameter is the
content of the control's client area after the new transition frame.
When PicShow is running in Threaded mode, this event
occurs in control's thread.
- OnBeforeNewFrame:
TCustomDrawEvent
TCustomDrawEvent
= procedure(Sender: TObject; Picture, Screen: TBitmap) of object
This event is triggered just before creating a
new frame of the transition. The
Picture parameter is the original image and the Screen parameter is the content
of the control's client area before the new transition frame.
When PicShow is running in Threaded
mode, this event occurs in control's thread.
- OnChange:
TNotifyEvent (TPicShow only)
Occurs when content of Picture property has
changed.
- OnStart:
TCustomDrawEvent
TCustomDrawEvent = procedure(Sender: TObject; Picture, Screen: TBitmap) of
object
Occurs before beginning of the transition. After
calling Execute Method, the control copies the loaded image into a
bitmap and use it for transition purpose. The
Picture parameter is the original image and the Screen parameter is the content
of the control's client area just before any transition. When
this event is triggered, you can load another image into the component for
the next transition.
- OnStop:
TNotifyEvent
Occurs when transition is completed or aborted.
- OnComplete:
TNotifyEvent
Occurs when the transition effect has compeleted
normally. If transition stops by calling Stop method, this event does
not occur.
- OnProgress:
TNotifyEvent
Occurs just after drawing a frame of the transition on the client area
of the control.
When
PicShow is running in Threaded mode, this event occurs in control's thread.
- OnCustomDraw:
TCustomDrawEvent
TCustomDrawEvent = procedure(Sender: TObject; Picture, Screen: TBitmap) of
object
If Style property set to 0, this event is
triggered when the control needs to create a new frame of the transition.
The Picture
parameter is the original image and the Screen parameter is the content of
the control's client area, which should be updated.
When PicShow is running in Threaded
mode, this event occurs in control's thread.
- OnMouseEnter:
TNotifyEvent
Occurs when the mouse pointer moves over the control.
- OnMouseLeave:
TNotifyEvent
Occurs when the mouse pointer moves off from over
the control.
- OnAfterLoadPicture:
TNotifyEvent (TDBPicShow only)
Occurs when a new picture is loaded into the control.
- OnBeforeLoadPicture:
TNotifyEvent (TDBPicShow only)
Occurs when a new picture is being load into the
control.
- OnGetCraphicClass:
TGetGraphicClassEvent(TDBPicShow only)
TGetGraphicClassEvent = procedure(Sender: TObject; var GraphicClass: TGraphicClass)
of object;
Occurs when a new picture is about to load into
the control. TDBPicShow can recognize JPEG images stored in blob fields, however
it treats all other graphic formats as bitmap. This event gives this opportunity
to the application to specify the graphic class type of the data in the blob
field.
KNOWN ISSUES
- The transition
of large images is slow.
- The control
does not support transparency.
HISTORY
- 3.08 (December
6, 2003)
- Native support for Windows Metafile (WMF) and Enhanced Metafile (EMF) image
formats added to TDPicShow.
- 3.07 (November
17, 2003)
- The rotational effects (119..122) are optimized.
- 3.06 (September
8, 2003)
- The bug in setting StyleName property fixed (Thanks to Terry
Bogard).
- 3.05 (July
26, 2003)
- The definition of the OnStart event changed. Now the event passes
the original image and its underlying screen as two bitmaps to the handler.
- The new property OverDraw is added. When this property is True, the
control draws the new transition over the last one, otherwise before starting
a new transition it clears the screen to the background.
- 3.04 (July
12, 2003)
- The bug on uninitialized off-screen bitmap fixed (Thanks to Miguel
Gastelumendi Dargent).
- 3.03 (July
6, 2003)
- The bug of corrupted image after loading it to TDBPicShow fixed.
- 3.02 (May
29, 2003)
- The bad result on rendering stretched images on Windows 2000 and XP
fixed.
- 3.01 (May
8, 2003)
- The code related to thread's termination optimized (Thanks to Viatcheslav
V. Vassiliev).
- 3.0 (February
16, 2003)
- Transition effects moved to a separate unit.
- The number effects increased to 150 effects.
- 2.813 (January
11, 2003)
- Known bugs of TDBPicShow fixed (Thanks to Vicente
Santamaría Vázquez).
- 2.812 (October
25, 2002)
- The components prevented Windows for being shutdown. This bug fixed.
- 2.811 (September
28, 2002)
- Bug on proportional scaling of the image fixed.
- 2.81 (September
26, 2002)
- There was a memory leak on loading large images (more than 1MB) to the
control, which is fixed.
- Race condition problem of the thread in TDBPicShow fixed.
- New event OnGetGraphicClass added to TDBPicShow.
- Algorithm of image rotation optimized.
- 2.8 (September
10, 2002)
- Control's thread optimized. In threaded mode, control does not call
Delphi Synchronize function anymore to synchronize itself with the main VCL
thread. As the result, no more deadlock, faster thread termination, lower
CPU usage, and smoother transitions. However, because of this change, the
control cannot be compiled as non-windowed control anymore.
- Now changing the value of Manual, Progress, and Reverse
properties at the last step of transition takes effect.
- New method OnStop added.
- 2.68 (Julay
9, 2002)
- Minor bug fix.
- 2.67 (June
5, 2002)
- Bug on releaseing the thread fixed.
- 2.66 (May
9, 2002)
- Memory leak bug fixed.
- 2.65 (March
8, 2002)
- A minor bug on effect number 118 (Fade) fixed.
- 2.64 (February
9, 2002)
- A little improvement in performance.
2.63 (January 14, 2002)
- Bug raised on thread during the previous upgrade, fixed.
- New event OnStart added.
- 2.62 (December
29, 2001)
- Support for Delphi 6.0 Added.
- Now both controls as default are windowed control. To change them from windowed
control to non-windowed control, edit PicShow.pas and remove definition
of WINCONTROL_PICSHOW compiler symbol.
- 2.61 (April
18, 2001)
- New property StyleName added. This property is as same as Style
property but uses name of the transition instead of its index (Thanks to Gary
Bond).
- 2.60 (February
21, 2001)
- Native JPEG support added to TDBPicShow (Thanks to Ken
Otto)
- OnAfterLoadPicture and OnBeforeLoadPicture added events added
to TDBPicShow (Thanks to Ken Otto)
- A memory leak bug fixed (Thanks to Ken
Otto)
- 2.50 (September
7, 2000)
- 5 new effects added; now 127 effects (Thanks to Elliott
Shevin for 4 of these effects).
- Component editor improved.
- 2.40 (June
16, 2000)
- TDBPicShow is data-aware version of TPicShow that added to this version
of the component set.
- 2.32 (June
14, 2000)
- Since to this version, TPicShow only was a windowed control. Now, TPicShow
can be a windowed or non-windowed control depending to definition of WINCONTROL_PICSHOW
compiler directive.
- 2.31 (June
12, 2000)
- OnBeforeNewFrame and OnAfterNewFrame events added.
- 2.30 (February
27, 2000)
- Memory leak bug fixed.
- 2.20 (February
6, 2000)
- Now, all styles can be played as reverse.
- Reverse property added.
- Now the value of Progress property can be manually decremented for
all styles.
- OnMouseEnter and OnMouseLeave events added
- the parameters of OnCustomDraw event changed.
- Some comments added to the source of demo application.
-
2.11 (February
1, 2000)
- A minor bug fixed.
- 2.10 (January
31, 2000)
- 5 new effects added; now 122 effects.
- Property editors placed in a separate unit (Delphi 5 consideration).
- Known bugs fixed.
- 2.00 (December
12, 1999)
- Manual animation control added (Thanks to Jerry
McLain for the idea).
- Now all styles, play the image with an equal speed.
- Stretch can keep the image aspect ratio.
- Delay, Manual, Progress, StretchFine, and ThreadPriority
properties added.
- OnCustomDraw and OnProgress events added.
- 1.50 (November
17, 1999)
- now Delphi 3.0 is supported.
- Icon support added.
- 1.40 (November
16, 1999)
- 8 new effects added; now 117 effects (Thanks to M.
R. Zamani for these effects).
- All reported bugs fixed.
- 1.30 (November
11, 1999)
- BgMode and BgPicture properties added.
- 32 new effects added; now 109 effects.
- Thread management improved.
- 1.20 (November
9, 1999)
- Empty property added.
- OnChange event added.
- Stop method added.
- 30 new effects added; now 77 effects.
- all known bugs fixed.
-
1.10 (November
6, 1999)
- Busy property added.
- Some bugs fixed.
- 1.00 (November
5, 1999)
- Initial release with 47 effects.
ACKNOWLEDGMENT
Special thanks
to:
LICENSE
PicShow family
components are freeware. You may copy component's files AS LONG AS YOU COPY
ALL OF THEM. If you want to change the source code in order to improve the
components' features, performance, etc. please send me the new source code
so that I can have a look at it. The changed source code should contain descriptions
what you have changed, and of course your name. The only thing you MAY NOT
CHANGE is the ORIGINAL COPYRIGHT INFORMATION.
DISCLAIMER
PicShow family
components are provided "AS IS" without any warranty of any kind,
either express or implied. The entire risk as to the quality and performance
of the software is with you. The author is NOT liable for any DAMAGES resulting
from the use and misuse of the components, especially he is NOT liable for
DAMAGES that were caused BY ANY VERSION WHICH HAS NOT BEEN PROGRAMMED BY THE
AUTHOR HIMSELF.