简体   繁体   English

如何从UIImageView获取图像?

[英]How to get the Image from a UIImageView?

I am new in iOS application Development. 我是iOS应用程序开发的新手。 I need help on UIImageView. 我需要有关UIImageView的帮助。 I need to send an Image to the server which the user will sketch. 我需要将图像发送到用户将草绘的服务器。 In my application i am using UIImageView on which user can sketch and fill colors etc its like a pain application. 在我的应用程序中,我使用的是UIImageView,用户可以在其上绘制和填充颜色等,就像痛苦的应用程序一样。 now i need to send that sketch to server as user will click on UPDATE button. 现在我需要将该草图发送到服务器,因为用户将单击“更新”按钮。 for sending the data through web service, i have to send it as a binary string i think. 为了通过Web服务发送数据,我必须将其作为二进制字符串发送。 every thing is working fine and clear to me. 每件事对我来说都很好而且很清楚。 The problem is how to get the image from UIImageView with out saving it to core data or sq-lite as i don't want to save that image permanently. 问题是如何从UIImageView获取图像而不将其保存到核心数据或sq-lite,因为我不想永久保存该图像。

Is it Possible to get UIImage from an UIImageView without using core data or sq-lite? 是否可以在不使用核心数据或sq-lite的情况下从UIImageView获取UIImage?

If you need to Get UIImage for UIImageView then try this. 如果您需要为UIImageView获取UIImage ,请尝试此操作。

UIImageView *imageView = ... //here is your UIImageView.

UIImage *image = imageView.image; //Here is you UIImage

if any issue please let me know. 如有任何问题,请通知我。

I didn't understand your question completely. 我不完全明白你的问题。

For getting image from UIImageView 用于从UIImageView获取图像

UIImage *image = imageView.image;

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

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