How to get the Image from the Image Control in WPF [Resolved]

Posted by Anwarcode under WPF on 1/27/2010 | Views : 15514 | Status : [Member] | Replies : 8
eg. int i =10 ;
means variable i has value 10
<Image x:Name="imageViewer" Source= somepath />
now what is/how to get the value or image imageviewer programatically?
Please help me through this




Responses

Posted by: Abhi2434 on: 1/30/2010 [Member] [Microsoft_MVP] [MVP] Silver

Up
0
Down

Resolved
I mean what is the problem with that too.. Source property does have Getter. So you can easily use
BitmapImage image = imageViewer.Source;

I hope this is what you wanted, right.

www.abhisheksur.com

Anwarcode, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Abhi2434 on: 1/28/2010 [Member] [Microsoft_MVP] [MVP] Silver

Up
0
Down
Are you asking how we can set an image?

BitmapImage image = new BitmapImage(new Uri(path));

imageViewer.Source = image;


Is this what you require?

:)

www.abhisheksur.com

Anwarcode, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Anwarcode on: 1/28/2010 [Member] Starter

Up
0
Down
Thanks Abhi for your response

I want the reverse of it
Actually I want to fetch the content of Image and assign it to some other variable.

BitmapImage image = new BitmapImage(new Uri(path));

imageViewer.Source = image;

now the next thing I want is

Somevariable = ImageViewer.Source
//Is this possible or what is other way to fetch the image from the Imageview and assing it to other variable



Anwarcode, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Anwarcode on: 1/28/2010 [Member] Starter

Up
0
Down
Thanks Abhi for your response

I want the reverse of it
Actually I want to fetch the content of Image and assign it to some other variable.

BitmapImage image = new BitmapImage(new Uri(path));

imageViewer.Source = image;

now the next thing I want is

Somevariable = ImageViewer.Source
//Is this possible or what is other way to fetch the image from the Imageview and assing it to other variable



Anwarcode, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sagarp on: 1/29/2010 [Member] Bronze

Up
0
Down
ref


http://www.codeproject.com/KB/WPF/ImageCropper.aspx

Thanks
SagarP
http://www.emanonsolutions.net
http://emanonsolutions.blogspot.com/

Anwarcode, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sagarp on: 1/29/2010 [Member] Bronze

Up
0
Down
hi

check this link'

http://www.codeflakes.net/blog/post/How-to-create-great-image-effects-with-WPFXAML.aspx

Thanks
SagarP
http://www.emanonsolutions.net
http://emanonsolutions.blogspot.com/

Anwarcode, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Anwarcode on: 2/1/2010 [Member] Starter

Up
0
Down
Thanks Abhi that is what I required and it cleared my doubt and solved the problem. Thanks again and best of luck.

Again Thanks Sagarp thank you all guys your concern and effort really is helping to fix the problem other side of the network.

Anwarcode, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Arronlee on: 4/14/2014 [Member] Starter | Points: 25

Up
0
Down
Here are the related tutorials about the image control ( http://www.yiigo.com/guides/vbnet/ ) I have ever tested before. You can google it and have a try. I hope you success. Good luck.

Anwarcode, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response