Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: WPF
Hi ,I need to display a gif image from assembly on my wpf page.
i need to display the image within the control picturebox.. anybody please help me with this
Posted 10-Sep-12 18:14pm
Edited 11-Sep-12 17:38pm
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Hi everybody,
i don't know if its the right solution.... but i found its working fine.

Here is my solution and i am giving it step by step
 

1.Add references windows.forms and form.integration to your wpf project
2.introduce namespaces
xmlns:wfi="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"

xmlns:winForms="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms">
 
This integrates form properties with wpf.
now we can freely use the form based control picturebox within wpf
3.




 
4.After it obtain the executing assembly and the input image source for picturebox as stream..
 
System.Reflection.Assembly assembly=System.Reflection.Assembly.GetExecutingAssembly();

System.IO.Stream stream = (System.IO.Stream)assembly.GetManifestResourceStream("MyProjectLibrary.Images.blink.gif");

pictureBox.Image = System.Drawing.Image.FromStream(stream);

And
my thanks to MehdiGholam for the reference link
  Permalink  
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web01 | 2.8.140926.1 | Last Updated 15 Sep 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100