Question is how to differentiate this 2 image format if i were to drag an jpg
image or gif
image to inkcanvas
?
When i run it, i drag my gif
image to the inkcanvas
but it didnt went to the first condition. It went to the else if.
gif
is declare on top as
Viewbox vbMedia = new Viewbox();
MediaElement gif = new MediaElement();
if (gif.Source == new Uri("E:\\New folder\\Drawing\\Images\\Themes\\Gif\\bruce.gif", UriKind.Absolute))
{
vbMedia.Width = 70;
vbMedia.Height = 70;
gif.LoadedBehavior = MediaState.Play;
gif.UnloadedBehavior = MediaState.Play;
vbMedia.RenderTransform = group;
vbMedia.Child = gif;
this.InkCanvas1.Children.Add(vbMedia);
}
else
{
image.Width = 70;
image.Height = 70;
image.RenderTransform = group;
this.InkCanvas1.Children.Add(image);
}