์๋
ํ์ธ์.
ํด์๋๋ 1920 X 1080 ์
๋๋ค.
Gpu๋ฅผ ์ต๋ํ ๋ฎ๊ฒ ๊ฐ์ ธ๊ฐ๋ ค๋ ์ด์ ๊ฐ ํ์ฅ๋๊ป์ ๋ผ์ฆ๋ฒ ๋ฆฌ์ AI์ ์ผ๋ถ๊ธฐ๋ฅ์ ์ฌ๋ฆด์ง๋ ๋ชจ๋ฅด๋ Gpu๋ฅผ ์ต๋ํ ์ค์ฌ๋ณด๋ผ๊ณ ํ์๊ณ ๋จ์ ์ ํ์ด๋ ๋์ฌ๋ณด๋ ํ๋ก๊ทธ๋จ์ธ๋ฐ Gpu๋ฅผ ๋๊ฒ ์ฐ๋๊ฒ ์ด์ํ๋ค ํฉ๋๋ค.
๊ฐ๋ง ์๊ฐํด๋ณด๋ ์๊ตฌ์ฌํญ์ ๋ ๋์ ๋จ์ํ ๊ฐ์ฒด ์ด๋ ์ ๋๋ฉ์ด์
์ธ๋ฐ Gpu๋ฅผ ์ฌ์ฉํ๊ฒ๋ ๊ฐ์ธ์ ์ผ๋ก ๊ถ๊ธํ๊ธฐ๋ ํฉ๋๋ค. (ํ์ฅ๋๊ป์๋ ์ด๋์ ๋ฐ๋ฅธ ํ๋ฉด์ ๋ค์ ๊ทธ๋ฆฌ๋ ๊ฒ ์๋๋๊ณ ์์ฌํฉ๋๋ค.)
๊ฐ์ฒด์ ์ ๋๋ฉ์ด์
์ ๊ฑธ์ด ์บ๋ฒ์ค์ ์์์ผ๋ก ๋ฃ์ด Left ๊ฐ์ ๋๋ ค์ ์ด๋์ ๊ตฌํ ํ๊ณ ์ ๋๋ฉ์ด์
๊ฐ ํฌ์ธํธ๋ง๋ค ์ด 3๊ฐ๋ก ๊ตฌ์ฑ๋์์ต๋๋ค.
(์บ๋ฒ์ค์ ์์ฑ๋ ๊ฐ์ฒด๋ฅผ ์์์ผ๋ก ์ถ๊ฐ๋ mainWindow ๋นํ์ธ๋์ฝ๋์ ๊ธฐ์ ๋์ด ์์ต๋๋ค.)
๊ฐ์ฒด๊ฐ ๋์ด๋๋ฉด ์ ๋๋ฉ์ด์
์ด ์คํ ์๊ฐ ๋์ด๋๋ Gpu๊ฐ ์ฌ๋ผ๊ฐ๊ฑฐ๋ผ ์์ํ์ง๋ง ๊ฐ์ฒด๊ฐ 1๊ฐ๋ง ์์ด๋ 80%๋ฅผ ์ฐ๋ค์ ใ
ใ
;;
์๋๋ ์ฃผํฉ์ ์ ํ ๊ฐ์ฒด์ ์ ๋๋ฉ์ด์
๊ด๋ จ ์ฝ๋์
๋๋ค.
....์ค ๋ต....
animation1 = new Animation
{
Duration = TimeSpan.FromSeconds(3),
IterationCount = new IterationCount(1),
FillMode = FillMode.Forward,
Children =
{
new KeyFrame
{
Cue = new Cue(0.0),
Setters =
{
new Setter(Canvas.LeftProperty, Convert.ToDouble(0))
}
},
new KeyFrame
{
Cue = new Cue(1),
Setters =
{
new Setter(Canvas.LeftProperty , Convert.ToDouble(240))
}
},
}
};
animation2 = new Animation
{
Duration = TimeSpan.FromSeconds(5),
IterationCount = new IterationCount(1),
//PlaybackDirection = PlaybackDirection.Normal,
FillMode = FillMode.Forward,
Children =
{
new KeyFrame
{
Cue = new Cue(0.0),
Setters =
{
new Setter(Canvas.LeftProperty, Convert.ToDouble(240))
}
},
new KeyFrame
{
Cue = new Cue(1.0),
Setters =
{
new Setter(Canvas.LeftProperty , Convert.ToDouble(665))
}
}
}
};
animation3 = new Animation
{
Duration = TimeSpan.FromSeconds(1.8),
IterationCount = new IterationCount(1),
//PlaybackDirection = PlaybackDirection.Normal,
FillMode = FillMode.Forward,
Children =
{
new KeyFrame
{
Cue = new Cue(0.0),
Setters =
{
new Setter(Canvas.LeftProperty, Convert.ToDouble(665))
}
},
new KeyFrame
{
Cue = new Cue(1.0),
Setters =
{
new Setter(Canvas.LeftProperty , Convert.ToDouble(826))
}
},
}
};
eClipse.Stroke = new SolidColorBrush(Colors.Black);
eClipse.StrokeThickness = 1;
grid.Children.Add(eClipse);
eClipse.HorizontalAlignment = Avalonia.Layout.HorizontalAlignment.Center;
Style style = new Style(x => x.OfType<Grid>().Name("go2"));
style.Animations.Add(animation1);
style.Animations.Add(animation2);
style.Animations.Add(animation3);
....์ค๋ต.....
public async Task decision1()
{
await animation1.RunAsync(grid , cancellationTokenSource.Token);
await decision2();
}
public async Task decision2()
{
await Task.Delay(500);
await animation2.RunAsync(grid, cancellationTokenSource.Token);
await decisionFinal();
}
public async Task decisionFinal()
{
await Task.Delay(500);
await animation3.RunAsync(grid);
await Task.Delay(500);
this.Dispose();
}
public void Dispose()
{
((Canvas)grid.Parent).Children.Remove(grid);
}