uiimage Questions
3
I use this function to detect if UIImage has transparency:
extension UIImage {
public func isTransparent() -> Bool {
guard let alpha: CGImageAlphaInfo = self.cgImage?.alphaInfo else { return f...
27
I've seen posts regarding right alignment but I can't get left-alignment to work. I want the button to take up the width of the screen, with the image on the left and the title/text in the center.
...
18
There are plenty of threads about aligning a button image according to the title text, but I can't find anything about just aligning the image to the right side of the button.
This has no effect:
...
Trailer asked 3/9, 2015 at 1:14
8
Solved
I'm facing an image orientation issue when cropping a square portion of an image out of a rectangular original image. When image is in landscape, it's fine. But when it is in portrait, it seems tha...
1
Solved
As per Apple docs, the rendering mode of .automatic for a UIImage leads to a behavior where the image is drawn "using the context’s default rendering mode".
What is this "context's r...
Primaveria asked 2/3, 2023 at 12:48
4
I have the following pre-packaged, system SF image:
UIImage(systemName: "location.fill")
It may seem trivial, but how can I resize it to make it bigger? Thank you.
Jailbreak asked 29/3, 2020 at 6:2
5
Solved
I searched everywhere but didn't find the solution. I have image 1. How can I programatically tint them with gradient to get images 2 and 3? Here are those images:
Tints that I applied to them v...
Rhyner asked 11/11, 2011 at 18:8
7
Solved
I need to get a pure black and white UIImage from another UIImage (not grayscale). Anyone can help me?
Thanks for reading.
EDITED:
Here is the proposed solution. Thanks to all. Almost I know tha...
Diu asked 9/12, 2010 at 18:8
21
Solved
I've been searching google, and have only come across libraries that either reduce the height/width or some how edit the UIImage appearance via CoreImage. But I have not seen or found one library, ...
0
Consider the following code:
let img = UIImage(named: "myString")
if let img = img {
mySCNMaterial.diffuse.contents = img
}
I was using this to load images in a SceneKit project. Speci...
Luby asked 7/12, 2022 at 7:41
2
Solved
I am experimenting with iOS SDK and I have the following UIView structure:
UIView
UIImageView - only a background image
UIImageView (with a CALayer mask)
UIScrollView
Label
Very simple stru...
Gamboge asked 11/7, 2013 at 11:32
2
Solved
Xcode optimizes png images so they are loaded faster, but is this also recommended for other image resources that are not for buttons and UI (Photos for example)?
Or is it a standard to have UI im...
2
How can I aligment an image to the right edge of an UIButton, so it will stay at the right edge for all devices. The image below shows and UIButton with an image (circle-triangle). The image is a s...
33
Solved
In my iPhone app, I take a picture with the camera, then I want to resize it to 290*390 pixels. I was using this method to resize the image :
UIImage *newImage = [image _imageScaledToSize:CGSizeM...
6
Solved
It's a pretty straight-forward question - How does one apply a border effect to only the wanted edges of an Image with SwiftUI?
For example, I only want to apply a border to the top and bottom edge...
2
How to flip an UIImage vertically (up/down)? This is a question that is asked before...
Flip UIImage Along Either Axis
How to flip UIImage horizontally?
How to flip UIImage horizontally with Swif...
Tipton asked 26/11, 2018 at 12:31
2
Solved
I find the behavior of the new iOS 13 UIImage property withTintColor(_:renderingMode:) incomprehensible. What is it for, and how does it relate to the tint color of the context in which the image a...
6
Solved
I have a NSAttributedString to which I am adding a NSTextAttachment. The image is 50w by 50h but I'd like it to scale down to reflect the line height of the attributed string. I thought this would ...
Thrasonical asked 12/3, 2014 at 16:2
4
Solved
I am using Assets Catalog, and adding app icon of various size to the assets is okay.
But when I tried to get the UIImage programmatically, it returned nil.
UIImage *appIcon = [UIImage imageNamed...
Pegg asked 2/4, 2014 at 10:23
4
Solved
I want to use the function CGImageSourceCreateThumbnailAtIndex to create a thumbnail from an UIImage. All I have is the UIImage itself. The image is the snapshot on a UIView.
Please, I don't want ...
Bangle asked 18/11, 2016 at 11:11
8
8
Solved
Swift 4 has Codable and it's awesome. But UIImage does not conform to it by default. How can we do that?
I tried with singleValueContainer and unkeyedContainer
extension UIImage: Codable {
// 'r...
6
Solved
I am using an UIImage, in which I have an Image, and I want to know the name of image.
Absorptivity asked 23/4, 2012 at 11:4
2
Solved
This is the code I am using
extension UIImage {
var ellipseMasked: UIImage? {
guard let cgImage = cgImage else { return nil }
let rect = CGRect(origin: .zero, size: size)
return UIGraphicsIm...
Wilmer asked 18/1, 2020 at 21:32
16
Solved
I am trying to set an Image for bar button Item for that I have an image like:
with resolution 30 * 30 but while I assign this Image to Bar button Its looks like:
I have assigned image this w...
Bren asked 16/12, 2014 at 7:58
© 2022 - 2025 — McMap. All rights reserved.