|
Here is an example of animating on mouseover:
<Trigger Property="IsMouseOver" Value="True">
<Trigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation
Storyboard.TargetName="Border"
Storyboard.TargetProperty="Opacity"
To="1"
Duration="0:0:0.1" />
</Storyboard>
</BeginStoryboard>
</Trigger.EnterActions>
</Trigger>
Also, check out this link Storyboard Class[^]
Regards,
Lev
|
|
|
|
|
Hi,
I want to play video files using MediaElement in WPF. It is not working with QuickTime files like .mov or .3gp. I have QuickTime DirectShow filter on my PC and these files running fine with Window Media Player 10.0 after installation of this filter.
Kindly help me....
Thanks in advance
Firoz
|
|
|
|
|
|
Hello.
I'm working with Expression Blend 2.
SomeTimes I see d:LayoutOverrides="Height" or d:LayoutOverrides="Width" in the XAML code.
What's that?
What dose it do ?
|
|
|
|
|
See here[^]
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi, I would like to know if I can use the slider control properties to create a knob control in XMAL and how to code it.
|
|
|
|
|
|
|
Jammer,
I'll check this out. Thanks for the heads up!
modified 27-Feb-21 21:01pm.
|
|
|
|
|
Hi,
I have a MultidataTrigger Condition style thats been implemented to a TextBox [1]. I also have another style which I require to implement on the NameTextBox. How do we implement multiple styles on a Text Box?
[1]
<TextBox x:Name="NameTextBox" Style="{StaticResource requiredFieldValidationTextBoxStyle}" Text="{Binding Path=Name}" Width="100"/>
Regards,
Vipul Mehta
|
|
|
|
|
You can't as far as I know.
|
|
|
|
|
You have to create a new style - you could always have this style BasedOn the initial style, and then implement the bits you need on top.
|
|
|
|
|
Pete is correct here.
modified 27-Feb-21 21:01pm.
|
|
|
|
|
That's not really using two styles on a control though is it? It's just basing one style on another style as far as I can tell.
|
|
|
|
|
True - that's why I said you had to create a new style. There's no way round this as you noted earlier.
|
|
|
|
|
|
And to clarify the point, I 5d your answer above. That should make it plain for the OP.
|
|
|
|
|
I've not actually used the BasedOn approach to a styles yet. Could prove interesting to see how it actually works.
|
|
|
|
|
I use it a lot - it's incredibly useful.
|
|
|
|
|
Hello,
I am still having a trouble cropping with my project I am trying to create, which I have included the code and the XAML code below. For my project, i am trying to have the user click on the button "crop image" then they are given the ability to highlight the area to crop, and right click and save the crop image as jpg or bmp, so far i have looked at several examples including jim's input (thank you jim again) but still is a little confusing to me, if someone can help me out with this by completing the missing piece (or finishing the project), and/or explain that would be great. I am willing to go even as far as talking over the phone or email just to help me because i feel this is an essential thing to learn using WPF/C# image object/bitmap. If anyone can help me out with this one i would be very very grateful. So again, the code is below so you can see what i got so far, which i like because you can zoom in and out of the image object called viewerphoto1 using the slider. Anyways here is the code below:
XAML:
<Window x:Class="WPFcropimage.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="370" Width="591">
<Grid Height="341" Width="595">
<DockPanel Margin="23,33,181,29">
<Slider x:Name="Zoom" DockPanel.Dock="Left" Value="1" Minimum="0.1" Maximum="5" Width="25" Orientation="Vertical" ValueChanged="Zoom_ValueChanged" />
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" Height="270" Width="356">
<Image Stretch="Uniform" Height="262" Width="349" Name="_viewedPhoto1">
<Image.LayoutTransform>
<ScaleTransform ScaleX="{Binding ElementName=Zoom,Path=Value}" ScaleY="{Binding ElementName=Zoom,Path=Value}"/>
</Image.LayoutTransform>
</Image>
</ScrollViewer>
</DockPanel>
<Button Height="38" HorizontalAlignment="Right" Margin="0,33,41,0" Name="_btnbrowse" VerticalAlignment="Top" Width="104" Click="_btnbrowse_Click">Browse for Picture</Button>
<Button Height="38" HorizontalAlignment="Right" Margin="0,89,41,0" Name="_btnCrop" VerticalAlignment="Top" Width="104" Click="_btnCrop_Click">Crop Picture</Button>
<Button Height="37" HorizontalAlignment="Right" Margin="0,0,41,33.5" Name="_btnClose" VerticalAlignment="Bottom" Width="104" Click="_btnClose_Click">Close</Button>
<Border Margin="53,37.5,187,33.5" Name="_border1" BorderBrush="Black" BorderThickness="2">
</Border>
</Grid>
</Window>
C# code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
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;
using System.Windows.Forms;
using System.Drawing.Imaging;
using System.Drawing;
namespace WPFcropimage
{
/// <summary>
/// Interaction logic for Window1.xaml
/// </summary>
public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
}
private void _btnbrowse_Click(object sender, RoutedEventArgs e)
{
OpenFileDialog dlg = new OpenFileDialog();
dlg.InitialDirectory ="c:\\";
dlg.Filter =
"Image files (*.jpg)|*.jpg|*.bmp)|*.bmp|All Files (*.*)|*.*";
dlg.RestoreDirectory =
true;
if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
string selectedFileName = dlg.FileName;
BitmapImage bitmap = new BitmapImage();
bitmap.BeginInit();
bitmap.UriSource =
new Uri(selectedFileName);
bitmap.EndInit();
_viewedPhoto1.Source = bitmap;
}
}
private void _btnClose_Click(object sender, RoutedEventArgs e)
{
this.Close();
}
private void Zoom_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
}
private void _btnCrop_Click(object sender, RoutedEventArgs e)
{
}
}
}
|
|
|
|
|
Hey everyone,
I was looking at this example from the link below, which i like, i am trying to have the user click on the button crop image, and thats when it will show the rectangle, however the description or the explanation is sorta hard to understand, can anyone help me with this, including how to get crop image to appear on the crop image viewer object?
thanks
link:
http://www.codeproject.com/KB/WPF/CropAdorner.aspx[^]
|
|
|
|
|
Using VS2008 Standard on XP/64:
I'm trying to do my first WPF app, and the IDE seems to have lost the ability to show properties for any control. The only way to fix it is to shut the IDE down and restart it, and then, it only works for the first control you try to view the properties for. What a POS...
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Wait, you were using the IDE? That's your problem, everybody knows that you shouldn't use XAML never mind the IDE, just use C#.
|
|
|
|
|
Did I miss something? Is there question here or just a rant?
only two letters away from being an asset
|
|
|
|
|
Looks like soapbox material to me!
Or maybe the MS complaint department redirects to here...
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|