简体   繁体   English

向画廊添加“可拉伸”图像并从画廊中选择图像

[英]Adding “stretchable” images to and image selected from gallery

Im trying to make an app for planning out where you want to put "shelves" on a wall (sounds strange i know ;) ) 我试图制作一个用于计划要在墙上放置“架子”的应用程序(听起来很奇怪;我知道))

i have got it so the image is picked from the UIImagePickerController then loaded in a new ViewController i also have a button at the bottom of the ViewController that i want to open a list of images to select from that once selected the user can move around then stretch the required size if they don't like, delete and once they are happy i want my second button to save the image and put it into an email ready for sending. 我有它,因此图像从采摘UIImagePickerController然后装在一个新的ViewController我也有一个button在底部ViewController ,我想打开图像的列表,以便一旦选择,用户可以左右移动,然后选择如果他们不喜欢,请拉伸所需的大小,然后删除,一旦他们满意,我希望我的第二个按钮保存图像并将其放入准备发送的电子邮件中。

I have looked at a few ways but none of them seem to be "adequate" would be so grateful anyone could suggest any ways or even help me with some code, I'm very new to this and this is my first app. 我已经研究了几种方法,但是似乎没有一种方法是“足够的”,因此非常感激任何人都可以提出任何方法,甚至可以帮助我编写一些代码,这对我来说是个新手,这是我的第一个应用程序。

Im not too sure on the code you'd need to see as none of what is written yet is relevant to this part of the app 我对您需要查看的代码不太确定,因为尚未编写的任何内容都与应用程序的这一部分相关

This is a 2 part so the first is, what way do i go about it?, the second is what code? 这是一个2部分,所以第一部分是,我应该怎么做?第二部分是什么代码?

Thanks 谢谢

-(UIImage *)GetStreachableImage

{ {

UIImage *takephotoButtonImagenormal = [UIImage imageNamed:CHOOSE_TAKE_NORMAL_IMAGE];

UIImage *strechableButtonImageNormal1 = [takephotoButtonImagenormal stretchableImageWithLeftCapWidth:takephotoButtonImagenormal.size.width/2 topCapHeight:takephotoButtonImagenormal.size.height/2];
    takephotoButtonImagenormal=nil;
     return strechableButtonImageNormal1;

} }

try this 尝试这个

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

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