Click here to Skip to main content
12,754,455 members (28,966 online)
Rate this:
 
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 19:14pm
Updated 11-Sep-12 18:38pm
v2
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.
<wfi:windowsformshost xmlns:wfi="#unknown">
<winforms:picturebox x:name="pictureBox" xmlns:x="#unknown" xmlns:winforms="#unknown">



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
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  

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

    Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.170217.1 | Last Updated 15 Sep 2012
Copyright © CodeProject, 1999-2017
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