简体   繁体   English

System.Drawing的C#Xamarin等效

[英]C# Xamarin equavalant of System.Drawing

I am trying to find the equivalent of System.Drawing for Android. 我试图找到与Android等效的System.Drawing。

As I found Converting UIImage to Byte Array but this seems to be only being used for iOS and within the xamarin docs is not much usefull to find http://androidapi.xamarin.com/?link=root%3a%2fmono-libs 正如我发现的将UIImage转换为字节数组,但是这似乎仅用于iOS,并且在xamarin文档中找不到http://androidapi.xamarin.com/?link=root%3a%2fmono-libs

The only thing I try to accomplish is to convert an image to an byte[] 我唯一要完成的就是将图像转换为字节[]

I know ho to use this: 我知道何使用此:

using (Stream stream = httpWebReponse.GetResponseStream())
            {
                image = Image.FromStream(stream);
                ImageConverter _imageConverter = new ImageConverter();
                bytes = (Byte[])_imageConverter.ConvertTo(image, typeof(Byte[]));
                height = image.Height;
                width = image.Width;
                size = image.Size;
            }

Also a possibillity for me is to get the image and being able to post it in an submit form to WS. 对我来说,也有可能获取图像并将其以提交形式发布到WS。 In other words if I am able the get the whole image and post this I would be also happy. 换句话说,如果我能够获得整个图像并将其发布,我也会很高兴。 IF something is unclear let me know. 如果有不清楚的地方,请通知我。

看一下Android.Graphics命名空间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM