나는 단순히 화면을 깜빡 거리게하려는 프로젝트에서 일하고 있습니다.깜박임 효과 애니메이션 C#
필자는 C#을 코딩하지 않았고 Visual Studio를 사용하지 않았기 때문에 내가하는 일에 대한 단서가 없습니다.
저는 방금 한 일의 빠른 자바 스크립트 버전을 작성했습니다. 여기에서 볼 수 있습니다.
http://jsfiddle.net/OwenMelbz/73Le7/
나는 VS 프로젝트 파일 http://www.mediafire.com/?6cji3czfsc6f5h3
여기내 xaml.cs 파일의 순간에있어 무엇을 첨부했습니다.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Timers;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace WpfApplication3
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
private static System.Timers.Timer testTimer;
public MainWindow()
{
InitializeComponent();
testTimer = new System.Timers.Timer(5000); // 5 seconds
testTimer.Elapsed += new ElapsedEventHandler(OnTimerElapsed);
testTimer.Interval = 5000;
testTimer.Enabled = true;
}
public void OnTimerElapsed(object source, ElapsedEventArgs e)
{
this.Dispatcher.Invoke((Action)(() =>
{
b1.Height = 420;
b2.Height = 420;
}));
this.Dispatcher.Invoke((Action)(() =>
{
b1.Height = 0;
b2.Height = 0;
System.Threading.Thread.Sleep(100);
}));
}
}
}
그리고 heres는 무엇 나는 MainWindow.xaml 자바 스크립트 데모에서
<Window x:Class="WpfApplication3.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="1440"
Name="Winda" AllowsTransparency="True" WindowStyle="None"
Opacity="1" Topmost="True" WindowStartupLocation="CenterScreen"
WindowState="Maximized" IsHitTestVisible="False" ShowInTaskbar="False" Background="Transparent">
<Grid>
<Rectangle Fill="Black" HorizontalAlignment="Left" Height="0" Stroke="Black" VerticalAlignment="Top" Width="1440" Stretch="Fill" Name="b1"/>
<Rectangle Fill="Black" HorizontalAlignment="Left" Height="0" Stroke="Black" VerticalAlignment="Bottom" Width="1440" Margin="0" Stretch="Fill" Name="b2"/>
</Grid>
</Window>
에있어, 나는 내가 할 노력하고있어 볼 수 있기를 바랍니다. 그래서 어떤 도움을 많이 주시면 감사하겠습니다!
감사합니다. 뒤에
당신은 C#에서 그래픽 클래스를 살펴 가질 수 여기 봐. drawing.graphics.aspx – Max