]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/animation.tex
added discussion of user-generated vs programmatic events
[wxWidgets.git] / docs / latex / wx / animation.tex
1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 %% Name: animation.tex
3 %% Purpose: wxAnimation documentation
4 %% Author: Francesco Montorsi
5 %% Created: 24-9-2006
6 %% RCS-ID: $Id$
7 %% Copyright: (c) 2006 Francesco Montorsi
8 %% License: wxWindows license
9 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10
11 \section{\class{wxAnimation}}\label{wxanimation}
12
13 This class encapsulates the concept of a platform-dependent animation.
14 An animation is a sequence of frames of the same size.
15 Sound is not supported by wxAnimation.
16
17 \wxheading{Derived from}
18
19 \helpref{wxGDIObject}{wxgdiobject}\\
20 \helpref{wxObject}{wxobject}
21
22 \wxheading{Include files}
23
24 <wx/animate.h>
25
26 \wxheading{Predefined objects}
27
28 Objects:
29
30 {\bf wxNullAnimation}
31
32 \wxheading{See also}
33
34 \helpref{wxAnimationCtrl}{wxanimationctrl}
35
36 \latexignore{\rtfignore{\wxheading{Members}}}
37
38
39 \membersection{wxAnimation::wxAnimation}\label{wxanimationctor}
40
41 \func{}{wxAnimation}{\void}
42
43 Default constructor.
44
45 \func{}{wxAnimation}{\param{const wxAnimation\& }{anim}}
46
47 Copy constructor.
48 wxAnimation objects are reference counted so that this operation is very fast.
49
50 \func{}{wxAnimation}{\param{const wxString\& }{name}, \param{wxAnimationType}{ type = wxANIMATION\_TYPE\_ANY}}
51
52 Loads an animation from a file.
53
54 \docparam{name}{The name of the file to load.}
55
56 \docparam{type}{See \helpref{LoadFile}{wxanimationloadfile} for more info.}
57
58
59 \membersection{wxAnimation::\destruct{wxAnimation}}\label{wxanimationdtor}
60
61 \func{}{\destruct{wxAnimation}}{\void}
62
63 Destroys the wxAnimation object and possibly the underlying animation data.
64 Because reference counting is used, the animation may not actually be
65 destroyed at this point - only when the reference count is zero will the
66 data be deleted.
67
68
69 \membersection{wxAnimation::GetDelay}\label{wxanimationgetdelay}
70
71 \constfunc{int}{GetDelay}{\param{size\_t }{i}}
72
73 Returns the delay for the i-th frame in milliseconds.
74 If {\tt -1} is returned the frame is to be displayed forever.
75
76
77 \membersection{wxAnimation::GetFrameCount}\label{wxanimationgetframecount}
78
79 \constfunc{size\_t}{GetFrameCount}{\void}
80
81 Returns the number of frames for this animation.
82
83
84 \membersection{wxAnimation::GetFrame}\label{wxanimationgetframe}
85
86 \constfunc{wxImage}{GetFrame}{\param{size\_t }{i}}
87
88 Returns the i-th frame as a \helpref{wxImage}{wximage}.
89
90
91 \membersection{wxAnimation::GetSize}\label{wxanimationgetsize}
92
93 \constfunc{wxSize}{GetSize}{\void}
94
95 Returns the size of the animation.
96
97
98 \membersection{wxAnimation::IsOk}\label{wxanimationisok}
99
100 \constfunc{bool}{IsOk}{\void}
101
102 Returns \true if animation data is present.
103
104
105 \membersection{wxAnimation::Load}\label{wxanimationload}
106
107 \func{bool}{Load}{\param{wxInputStream&}{ stream}, \param{wxAnimationType}{ type = wxANIMATION\_TYPE\_ANY}}
108
109 Loads an animation from the given stream.
110
111 \wxheading{Parameters}
112
113 \docparam{stream}{The stream to use to load the animation.}
114
115 \docparam{type}{One of the following values:
116
117 \twocolwidtha{5cm}
118 \begin{twocollist}
119 \twocolitem{\indexit{wxANIM\_TYPE\_GIF}}{Load an animated GIF file.}
120 \twocolitem{\indexit{wxANIM\_TYPE\_ANI}}{Load an ANI file.}
121 \twocolitem{\indexit{wxANIM\_TYPE\_ANY}}{Try to autodetect the filetype.}
122 \end{twocollist}
123 }
124
125 \wxheading{Return value}
126
127 \true if the operation succeeded, \false otherwise.
128
129
130 \membersection{wxAnimation::LoadFile}\label{wxanimationloadfile}
131
132 \func{bool}{LoadFile}{\param{const wxString\&}{ name}, \param{wxAnimationType}{ type = wxANIMATION\_TYPE\_ANY}}
133
134 Loads an animation from a file.
135
136 \wxheading{Parameters}
137
138 \docparam{name}{A filename.}
139
140 \docparam{type}{One of the following values:
141
142 \twocolwidtha{5cm}
143 \begin{twocollist}
144 \twocolitem{\indexit{wxANIM\_TYPE\_GIF}}{Load an animated GIF file.}
145 \twocolitem{\indexit{wxANIM\_TYPE\_ANI}}{Load an ANI file.}
146 \twocolitem{\indexit{wxANIM\_TYPE\_ANY}}{Try to autodetect the filetype.}
147 \end{twocollist}
148 }
149
150 \wxheading{Return value}
151
152 \true if the operation succeeded, \false otherwise.
153