English 中文(简体)
如何将《国际不动产合同》的意见转换到无背景的UIImage?
原标题:How to convert UIView to UIImage without background?

我有包含骨折图像和标签的《国际调查》意见,因为我们知道《国际调查意见》是直截了当的,如果我把《国际调查》的意见转换为“UIImage”也只是 rec,我想使UIImage像一个胎面形象一样,因为如果用户点击背景,UIImage事件也会被称作。 我想将《国际不动产业联合会》的意见转换到无其背景的UIImage?

我使用这种方法改变对UIImage公司的意见。

-(UIImage *) ChangeViewToImage : (UIView *) view{

UIGraphicsBeginImageContext(view.bounds.size);
[view.layer renderInContext:UIGraphicsGetCurrentContext()];
  UIImage *img = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();

    return img;
}

Hmm.. example like this, I have a rectangle as a UIView and a triangle as a shape in UIView. and then I want to make this UIView become a UIImage, but I just want the triangle without background, so the image just a triangle.. how can I do It?

最佳回答

湿度总是直截了当。 你可以做的是,你的看法不透明。 如果你除你的pin形象外,一切照样,就好像你刚刚掌握了pin。

使用:

view.backgroundColor = [UIColor clearColor];

使您的观点具有透明度。

问题回答

暂无回答




相关问题
How to change out-of-focus text selection color in Xcode?

Okay, I ll bite. I ve got really pleasant code/window colors set up in Xcode. Ordinarily, my selection color is very visible. When I am doing a project search and iterating through the results, ...

Iphone NSTimer Issue

Hi I am new to objective c. I am trying to make an app for iphone. I have a button on my view, and the click on which the function playSound is called. This is working properly. It does plays the ...

Include a .txt file in a .h in C++?

I have a number of places where I need to re-use some template code. Many classes need these items In a .h could I do something like: #include <xxx.txt> and place all of this code in the ....

Iterating over string/strlen with umlauted characters

This is a follow-up to my previous question . I succeeded in implementing the algorithm for checking umlauted characters. The next problem comes from iterating over all characters in a string. I do ...

Xcode open two editor windows with same file

Is it possible to open the same file in two separate windows in Xcode. I can open a file in one window and the same file in the main Xcode editor window, but I wanted two separate fulltime editor ...

Forcing code signing refresh in Xcode

In our environment, we share resources across multiple projects and platforms. When building for iPhone, only a subset of those resources are needed. Since that subset is still considerable, we have ...

热门标签