📄 readme.htm
字号:
<HTML>
<HEAD>
<TITLE>Home Page</TITLE>
<META NAME="GENERATOR" CONTENT="NotePad et al">
</HEAD>
<BODY BACKGROUND="Image1.jpg" BGPROPERTIES="fixed">
<P ALIGN="center">HarmFade Component, by Harm<BR>
<BR>
Copyright © 1998-1999 Technoid Brain Trust<BR>
All Rights Reserved<BR>
<BR>
<A HREF="mailto:sharman1@uswest.net">sharman1@uswest.net</A><BR>
<A HREF="http://www.users.uswest.net/~sharman1/">http://www.users.uswest.net/~sharman1/</A><BR>
<BR>
</P>
<P ALIGN="left">Version 2.4 - 10/99<BR>
<BR>
Added two new Events: OnMouseDown and OnMouseUp. Added one new property:
MSecPerFrame. Many thanks to Jens Doll for the addition of a timer to
keep the animation speed consistent, regardless of the speed of the machine. I
intended to get around to it some day, he saved me the hassle. I added the
MouseDown and MouseUp events at the request of Roger Swearingen. *Tech note -
in order for the mousedown/up events to fire, I had to remove the
'csNoStdEvents' from the ControlStyle. This was added for speed-up, but I don't
think it really matters much.</P>
<P ALIGN="left">Version 2.3 - 1/99<BR>
<BR>
Added three new Events: OnMouseEnter, OnMouseLeave, and OnClick. Added two new
methods: UnBlend and UnDissolve. These excellent suggestions came
from <A HREF="mailto:Douglas@rexburg.com">Douglas@rexburg.com</A>. This
makes HarmFade a little more useful - it can be used as a quasi-button.
The other change is this document, an attempted improvement over *.txt.
I'm assuming that anyone who downloads this component also has some sort of
browser.</P>
<P ALIGN="left"><A HREF="#Usage Notes">Usage Notes</A> - Miscellaneous info
<BR>
<A HREF="#Description">Description</A> - A description of this component and
its limitations<BR>
<A HREF="#System Requirements">System Requirements</A> - What you need to use
this component successfully<BR>
<A HREF="#License Agreement">License Agreement</A> - What's required for you to
use this component<BR>
<A HREF="#Credits">Credits</A> - People who have helped improve this component
<BR>
<A HREF="#Installation">Installation</A> - How to install this component<BR>
<A HREF="#Properties">Properties</A> - a description of the component
properties<BR>
<A HREF="#Methods">Methods</A> - a description of the component methods<BR>
<A HREF="#Events">Events</A> - a description of the component events<BR>
<A HREF="#Examples">Examples</A> - code snippets and suggestions to get you
going</P>
<P ALIGN="left"><A NAME="Usage Notes"></A><STRONG>Usage Notes</STRONG><BR>
For D3 users, your projects may need to have jpeg added to the uses clause in
order for them to work correctly with HarmFade. D4 seems to include it
automatically.<BR>
<BR>
If you have a GIFImage component installed, such as the excellent freeware
version by Anders Melander, you can use gif with harmfade also. Be aware that
transparency may cause odd behavior with gifs, since they are not specifically
addressed within Harmfade. Gif support is not a native Delphi TPicture format,
so I did not include code to deal with that. </P>
<P ALIGN="left"><A NAME="Description"></A><STRONG>Description<BR>
</STRONG>HarmFade is a Delphi Component that will transition between two
TPictures. It's a descendant of TGraphicControl. It currently has two
transitions: Blend and Dissolve. Blend is a gradual change of the pixels
from the first TPicture to the second TPicture. It's basically a series
of merge operations on the two images, changing the percentage from 100% of the
first picture to 100% of the second picture gradually. Dissolve is a
pixel swap operation, so that individual pixels are changed from the first
picture to the second picture. It can be used in about boxes for
interesting effects, or as a quasi-button. See the Examples section for
details on how to use HarmFade effectively.</P>
<P ALIGN="left"><A NAME="System Requirements"></A><STRONG>System Requirements
<BR>
</STRONG>HarmFade will only work with Delphi 3 or higher. It uses the
TBitmap.Scanline property introduced in D3, and will not compile in D1 or
D2. It also uses 24bit bitmaps. It will look OK on 16bit (High)
color and above, but looks like crap on 16 or 256 color monitors. I
developed this for my own purposes, and that's how my system is set up.
Sorry about that, but I'm not out to make any money on this, so what you see is
what you get. HarmFade is fairly fast, and should be fine on any Pentium
processor, but may be a bit on the slow side on anything less.</P>
<P ALIGN="left"><A NAME="License Agreement"></A><STRONG>License Agreement<BR>
</STRONG>This code is freeware. As such, you get what you pay for. No
warranties, express or implied, are provided. The author is not
responsible for any problems caused by this component. Use it at your own
risk. The author provides no support whatsoever, and is not obligated to
any person or corporation for anything related to this software. The
author reserves all rights concerning this code. You are free to use it
as you see fit, but if you make modifications or improvements that may benefit
the Delphi programming community, I would appreciate hearing from you.
This code cannot be sold for any purposes, or included in a commercial
collection, without the express written consent of the author. By
installing these files on your computer, you agree to all above
conditions. </P>
<P ALIGN="left"><A NAME="Credits"></A><STRONG>Credits<BR>
</STRONG>Many improvements have been made to the original version of this
component. I would like to thank those who have helped make this better,
I am always interested in learning how to improve the code/usability.<BR>
Jens Doll - added the code for consistent timing.<BR>
Sebastion LEON - Provided the assembler code to speed things up
dramatically. A major improvement. Thanks, Seb.<BR>
Cristian Brolin, Dean Crawford, and Douglas ? @Rexburg.com for great
suggestions on improvements.<BR>
Delphi programmers who have shared their code with the world so we can all
learn from it.<BR>
Team B and others who have taken the time to give advice and patient
explanations on the Borland newsgroups.</P>
<P ALIGN="left"><A NAME="Installation"></A><STRONG>Installation</STRONG></P>
<OL>
<LI><P ALIGN="left">Unzip the files</P>
</LI>
<LI><P ALIGN="left">Copy HarmFade.pas and HarmFade.dcr to the component folder
of your choice.</P>
</LI>
<LI><P ALIGN="left">From D3 or D4, select the Component menu item, then Install
(component). Browse to the foler where you copied the files.
Select HarmFade.pas and click OK until it's installed.</P>
</LI>
</OL>
<P ALIGN="left">By default, HarmFade will be placed on the Samples tab of the
Component palette. To change this, edit the source code and find the
register procedure. Change the 'Samples' to whatever tab you wish, then
re-install the component. Or, use the Configure Palette menu option to
move it to the tab you want.</P>
<P ALIGN="left"><A NAME="Properties"></A><STRONG>Properties</STRONG></P>
<TABLE BORDER="1" WIDTH="51%" STYLE="border: 1px">
<TR>
<TD WIDTH="45%"><STRONG>Property</STRONG></TD>
<TD WIDTH="55%"><STRONG>Type</STRONG></TD>
</TR>
<TR>
<TD WIDTH="45%"><A HREF="#AutoReverse">AutoReverse</A></TD>
<TD WIDTH="55%">Boolean</TD>
</TR>
<TR>
<TD WIDTH="45%"><A HREF="#BlendRate">BlendRate</A></TD>
<TD WIDTH="55%">Integer</TD>
</TR>
<TR>
<TD WIDTH="45%"><A HREF="#ColorFromTo">ColorFrom, ColorTo</A></TD>
<TD WIDTH="55%">TColor</TD>
</TR>
<TR>
<TD WIDTH="45%"><A HREF="#DisolvRate">DisolvRate</A></TD>
<TD WIDTH="55%">Integer</TD>
</TR>
<TR>
<TD WIDTH="45%"><A HREF="#Finish">Finish</A></TD>
<TD WIDTH="55%">Boolean</TD>
</TR>
<TR>
<TD WIDTH="45%"><A HREF="#HeightHint">Height</A></TD>
<TD WIDTH="55%">Integer</TD>
</TR>
<TR>
<TD WIDTH="45%"><A HREF="#HeightHint">Hint</A></TD>
<TD WIDTH="55%">String</TD>
</TR>
<TR>
<TD WIDTH="45%"><A HREF="#HeightHint">Left</A></TD>
<TD WIDTH="55%">Integer</TD>
</TR>
<TR>
<TD WIDTH="45%"><A HREF="#MSecPerFrame">MSecPerFrame</A></TD>
<TD WIDTH="55%">Integer</TD>
</TR>
<TR>
<TD WIDTH="45%"><A HREF="#HeightHint">Name</A></TD>
<TD WIDTH="55%">String</TD>
</TR>
<TR>
<TD WIDTH="45%"><A HREF="#HeightHint">ParentShowHint</A></TD>
<TD WIDTH="55%">Boolean</TD>
</TR>
<TR>
<TD WIDTH="45%"><A HREF="#PicFromTo">PicFrom, PicTo</A></TD>
<TD WIDTH="55%">TPicture</TD>
</TR>
<TR>
<TD WIDTH="45%"><A HREF="#PopupMenu">PopupMenu</A></TD>
<TD WIDTH="55%">TMenu</TD>
</TR>
<TR>
<TD WIDTH="45%"><A HREF="#ProcessMsgs">ProcessMsgs</A></TD>
<TD WIDTH="55%">Boolean</TD>
</TR>
<TR>
<TD WIDTH="45%"><A HREF="#ShowHint">ShowHint</A></TD>
<TD WIDTH="55%">Boolean</TD>
</TR>
<TR>
<TD WIDTH="45%"><A HREF="#StretchToFit">StretchToFit</A></TD>
<TD WIDTH="55%">Boolean</TD>
</TR>
<TR>
<TD WIDTH="45%"><A HREF="#SwapDelay">SwapDelay</A></TD>
<TD WIDTH="55%">Integer</TD>
</TR>
<TR>
<TD WIDTH="45%"><A HREF="#SwapOnReverse">SwapOnReverse</A></TD>
<TD WIDTH="55%">Boolean</TD>
</TR>
<TR>
<TD WIDTH="45%"><A HREF="#TagTop">Tag</A></TD>
<TD WIDTH="55%">Integer</TD>
</TR>
<TR>
<TD WIDTH="45%"><A HREF="#TagTop">Top</A></TD>
<TD WIDTH="55%">Integer</TD>
</TR>
<TR>
<TD WIDTH="45%"><A HREF="#TagTop">Visible</A></TD>
<TD WIDTH="55%">Boolean</TD>
</TR>
<TR>
<TD WIDTH="45%"><A HREF="#TagTop">Width</A></TD>
<TD WIDTH="55%">Integer</TD>
</TR>
</TABLE>
<P ALIGN="left"><A NAME="AutoReverse"></A><STRONG>AutoReverse</STRONG> - When
this is set to true, the blend or dissolve will reverse itself and do an
UnBlend or UnDissolve, depending on the SwapOnReverse setting. The delay
before reversal is set with the SwapDelay property.</P>
<P ALIGN="left"><A NAME="BlendRate"></A><STRONG>BlendRate</STRONG> - a value
from 1 - 255. This determines the speed of the blend transition.
Low values are faster. The smoothest blend rate is 32, but it's pretty
fast for smaller images. The speed of blend is dependent on the Image
size. It takes some experimentation with this value to determine the
optimum.</P>
<P ALIGN="left"><A NAME="ColorFromTo"></A><STRONG>ColorFrom, ColorTo</STRONG> -
If a PicFrom or PicTo is not assigned, these colors are used in their
stead. You could blend from solid black color to a Picture by setting
PicFrom to nil and setting ColorFrom to clBlack. If a PicFrom or PicTo is
assigned, these settings are ignored.</P>
<P ALIGN="left"><A NAME="DisolvRate"></A><STRONG>DisolvRate</STRONG> - a value
from 1 - (the HarmFade W x H). This is similar to the BlendRate, lower
numbers are faster. The speed of dissolve is also dependent on the image
size, and will take some experimentation to get set the way you want.</P>
<P ALIGN="left"><A NAME="Finish"></A><STRONG>Finish</STRONG> - This property is
not published, but is available in your application at run-time. Setting
this property to TRUE will force immediate completion of the transition.
You must set ProcessMsgs to true for this to work properly.</P>
<P ALIGN="left"><A NAME="HeightHint"></A><STRONG>Height, Hint, Left, Name,
ParentShowHint</STRONG> - These are normal Delphi VCL properties, common to all
Controls. See delphi help for a description of these.</P>
<P ALIGN="left"><B><A NAME="MSecPerFrame"></A>MSecPerFrame - </B>The number of
milliseconds for each frame of the animation. </P>
<P ALIGN="left"><A NAME="PicFromTo"></A><STRONG>PicFrom, PicTo</STRONG> - These
are the images that harmfade blends or dissolves. All of the normal
TPicture formats are supported: bmp, jpg, wmf, emf, and ico. They can be
assigned at design time via the object inspector, or loaded or assigned at
runtime with the normal TPicture methods. See Examples for more
information.</P>
<P ALIGN="left"><A NAME="PopupMenu"></A><STRONG>PopupMenu</STRONG> - Normal
Delphi PopupMenu, see Delphi help for information on usage.</P>
<P ALIGN="left"><A NAME="ProcessMsgs"></A><STRONG>ProcessMsgs</STRONG> - When
set to true, this will allow the blend or dissolve transition to be
'interrupted'. Normally, HarmFade uses tight loops for drawing and won't
allow other processing to take place during the transition. This must be
set to true for the Finish property to take effect.</P>
<P ALIGN="left"><A NAME="ShowHint"></A><STRONG>ShowHint</STRONG> - Normal
Delphi ShowHint property, see Delphi help for information on usage.</P>
<P ALIGN="left"><A NAME="StretchToFit"></A><STRONG>StretchToFit</STRONG> - When
set to true, this will stretchdraw the images to fit into the current HarmFade
dimensions. When set to false, HarmFade will resize itself to fit the
PicFrom image, unless: if PicFrom is not assigned, HarmFade will resize
itself to the PicTo dimensions. If neither is assigned, this property is
ignored.</P>
<P ALIGN="left"><A NAME="SwapDelay"></A><STRONG>SwapDelay</STRONG> - the amount
of time between transition and un-transition, in seconds. This property
is ignored if AutoReverse is false.</P>
<P ALIGN="left"><A NAME="SwapOnReverse"></A><STRONG>SwapOnReverse</STRONG> -
changes the transition when doing an UnBlend or UnDissolve. Ignored if
AutoReverse is false. If true, this will UnDissolve after a Blend, or
UnBlend after a Dissolve.</P>
<P ALIGN="left"><A NAME="TagTop"></A><STRONG>Tag, Top, Visible, Width</STRONG>
- These are normal Delphi VCL properties, common to all Controls. See
delphi help for a description of these.</P>
<P ALIGN="left"><A NAME="Methods"></A><STRONG>Methods</STRONG></P>
<TABLE BORDER="1" WIDTH="50%">
<TR>
<TD WIDTH="50%"><STRONG>Method</STRONG></TD>
<TD WIDTH="50%"><STRONG>Description</STRONG></TD>
</TR>
<TR>
<TD WIDTH="50%">Blend</TD>
<TD WIDTH="50%">This starts the transition using the Blend effect. It
blends from either PicFrom or ColorFrom to PicTo or ColorTo, depending on
propery settings.</TD>
</TR>
<TR>
<TD WIDTH="50%">Dissolve</TD>
<TD WIDTH="50%">This starts the transition using the Dissolve effect. It
dissolves from either PicFrom or ColorFrom to PicTo or ColorTo, depending on
property settings.</TD>
</TR>
<TR>
<TD WIDTH="50%">Reset</TD>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -