如何从WPF中的图像控件获取图像

问题描述:

如何从WPF中的图像控件获取图像

例如. int i = 10;
表示变量i的值为10

How to get the Image from the Image Control in WPF

eg. int i =10 ;
means variable i has value 10

<Image x:Name="imageViewer" Source= SomePath>



现在是什么/如何以编程方式获取值或imageimageviewer?
请帮助我


感谢Christian Graus的回应
实际上,我想获取Image的内容并将其分配给其他变量.



now what is/how to get the value or image imageviewer programatically?
Please help me through this


Thanks Christian Graus for your response
Actually I want to fetch the content of Image and assign it to some other variable.

ImageSource sc = imageViewer.Source;

我不确定您的int i = 10的示例意味着什么,只是您要说要从Image控件中为图像分配变量,对吗?
ImageSource sc = imageViewer.Source;

I''m not sure what your example for int i = 10 means, except that you''re saying you want to assign a variable to the image from an Image control, is that right ?