Új hozzászólás Aktív témák
-
cigam
titán
válasz
ferensz
#6499
üzenetére
Értem. Ez ugye nem fizetős? Akkor miért kell hozzá egy plusz "fejlesztői" licence? Ezzel mit vállalok magamra?
Karma
Köszi, de ehhez én kevés vagyok. Egy árva bötüt nem értek az egészből, pedig jópár oldalt átnyálaztam.
Ez pl. egy komplett kódnak tűbik, de még lefordítani sem tudom.
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
namespace AnimationCompletedTest {
public partial class MainWindow : Window {
Canvas panel;
public MainWindow() {
InitializeComponent();
MouseDown += DoDynamicAnimation;
Content = panel = new Canvas();
}
void DoDynamicAnimation(object sender, MouseButtonEventArgs args) {
for (int i = 0; i < 12; ++i) {
var e = new Ellipse { Width = 16, Height = 16, Fill = SystemColors.HighlightBrush };
Canvas.SetLeft(e, Mouse.GetPosition(this).X);
Canvas.SetTop(e, Mouse.GetPosition(this).Y);
var tg = new TransformGroup();
var translation = new TranslateTransform(30, 0);
var translationName = "myTranslation" + translation.GetHashCode();
RegisterName(translationName, translation);
tg.Children.Add(translation);
tg.Children.Add(new RotateTransform(i * 30));
e.RenderTransform = tg;
panel.Children.Add(e);
var anim = new DoubleAnimation(3, 100, new Duration(new TimeSpan(0, 0, 0, 1, 0))) {
EasingFunction = new PowerEase { EasingMode = EasingMode.EaseOut }
};
var s = new Storyboard();
Storyboard.SetTargetName(s, translationName);
Storyboard.SetTargetProperty(s, new PropertyPath(TranslateTransform.YProperty));
var storyboardName = "s" + s.GetHashCode();
Resources.Add(storyboardName, s);
s.Children.Add(anim);
s.Completed +=
(sndr, evtArgs) => {
panel.Children.Remove(e);
Resources.Remove(storyboardName);
UnregisterName(translationName);
};
s.Begin();
}
}
[STAThread]
public static void Main() {
var app = new Application();
app.Run(new MainWindow());
}
}
}
Új hozzászólás Aktív témák
● ha kódot szúrsz be, használd a PROGRAMKÓD formázási funkciót!
- Dobozos ÚJ ASUS TUF 17 Ryzen 9 7940HS 16 GB DDR5 512 SSD RTX 4070 (8 GB) 2.5K 240Hz Garancia
- Lenovo IdeaPad 5 Pro - 14" 2.8K 90Hz - i5-1135G7 - 8GB - 512GB SSD - Win11
- BESZÁMÍTÁS! MSI Gaming X RTX 3060Ti 8GB videokártya garanciával hibátlan működéssel
- HIBÁTLAN iPhone 15 Plus 256GB-1 ÉV GARANCIA - Kártyafüggetlen, MS4529
- HP EliteOne 800 G6 All-in-One i5-10500 32GB 1000GB 24" Érintőkijelző!! 1 év garancia
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest
