Click here to Skip to main content
Rate this: bad
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
Edited 11-Sep-12 18:38pm
Rate this: bad
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

This integrates form properties with wpf.
now we can freely use the form based control picturebox within wpf

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);

my thanks to MehdiGholam for the reference link
Rate this: bad
Please Sign up or sign in to vote.

Solution 1


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

  Print Answers RSS
0 Peter Leow 395
1 Sergey Alexandrovich Kryukov 350
2 Zoltán Zörgő 258
3 CHill60 195
4 CPallini 165
0 Sergey Alexandrovich Kryukov 8,943
1 OriginalGriff 6,631
2 Peter Leow 4,102
3 Zoltán Zörgő 3,714
4 Kornfeld Eliyahu Peter 2,525

Advertise | Privacy | Mobile
Web03 | 2.8.150123.1 | Last Updated 15 Sep 2012
Copyright © CodeProject, 1999-2015
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