AVI 클립을 제어하는 방법
이 항목에서는 애니메이션 컨트롤 매크로를 사용하여 연결된 AVI(Audio-Video Interleaved) 클립을 재생, 중지 및 닫는 방법을 보여 줍니다.
알아야 하는 작업
기술
필수 구성 요소
- C/C++
- Windows 사용자 인터페이스 프로그래밍
- AVI 파일
지침
애니메이션 컨트롤에 대한 핸들과 연결된 AVI 클립에서 수행할 작업을 나타내는 플래그를 매개 변수로 사용하는 함수를 만듭니다.
다음 C++ 예제의 함수는 nAction 매개 변수의 값을 기반으로 세 애니메이션 컨트롤 매크로(Animate_Play, Animate_Stop, Animate_Close) 중 하나를 호출합니다. AVI 클립과 연결된 애니메이션 컨트롤에 대한 핸들은 hwndAnim 매개 변수를 통해 전달됩니다.
// DoAnimation - plays, stops, or closes an animation control's
// AVI clip, depending on the value of an action flag.
// hwndAnim - handle to an animation control.
// nAction - flag that determines whether to play, stop, or close
// the AVI clip.
void DoAnimation(HWND hwndAnim, int nAction)
{
int const PLAYIT = 1, STOPIT = 2, CLOSEIT = 3;
switch (nAction) {
case PLAYIT:
// Play the clip continuously starting with the
// first frame.
Animate_Play(hwndAnim, 0, -1, -1);
break;
case STOPIT:
Animate_Stop(hwndAnim);
break;
case CLOSEIT:
Animate_Close(hwndAnim);
break;
default:
break;
}
return;
관련 항목