core-graphics Questions

7

I have an UIImage and want to shift it's saturation about +10%. Are there standard methods or functions that can be used for this?
Pennant asked 17/7, 2009 at 17:48

13

Solved

I want to set the UINavigationbar backgroundColor to a gradient color where I would like to set it via an array of colors to create a Gradient, ideally, as accessible methods inside UINavigationBar...
Peshawar asked 17/6, 2015 at 6:48

7

Solved

I'm getting this error when creating a bitmap context: CGBitmapContextCreate: unsupported parameter combination: 8 integer bits/component; 24 bits/pixel; 3-component color space; kCGImageAlphaNone...
Pantheas asked 23/11, 2012 at 10:58

4

Solved

I have a UIBezierPath and I would like to get its mirror image. How can I accomplish this? // Method for generating a path UIBezierPath *myPath = [self generateAPathInBounds:boundingRect]; // ...
Calvo asked 6/1, 2014 at 20:11

4

Solved

I’m looking to fade out a scrolling UITextView over a background image, something similar to the gradient at the top of this little example. I’m trying to work out how I can achieve this using C...
Parbuckle asked 7/7, 2014 at 15:50

4

Solved

I have an app where I take a UIBezierPath and use it as a brush by a series of appendPath: calls. After a few goes and with really complex brush shapes the memory runs out and the app grinds to a h...
Ranite asked 6/5, 2014 at 14:35

8

Solved

I want to know how to make a dashed line in swift like this: - - - - - - - - instead of a regular straight line like this: ----------------, I know that i can make multiple lines but that will requ...
Embrocation asked 15/8, 2016 at 19:13

8

Solved

I have designed the following code to generate a UIBezierPath. This path is used within a CAShapeLayer to mask a UIView. Note, the view's height and width are variable. This code generates a triang...
Stantonstanway asked 7/12, 2013 at 13:59

9

Solved

I have several .png images (ETA: but the format could also be JPEG or something else) that I am going to display in UITableViewCells. Right now, in order to get the row heights, I load in the image...
Linlithgow asked 11/10, 2009 at 18:2

9

Solved

I need to scale down an image, but in a sharp way. In Photoshop for example there are the image size reduction options "Bicubic Smoother" (blurry) and "Bicubic Sharper". Is this image downscaling ...
Mosquito asked 26/5, 2011 at 15:44

3

What I'm essentially trying to do is have a text label 'cut' a text-shaped hole through the view. I've tried using self.mask = uiLabel but those refused to position the text correctly so I'm approa...
Jonniejonny asked 26/7, 2017 at 1:54

17

Solved

I've been bashing my face into this one for literally days now and even though I feel constantly that I am right on the edge of revelation, I simply cannot achieve my goal. I thought, ahead of tim...
Spline asked 2/3, 2009 at 20:42

3

Solved

I have a line drawn by UIBezierPath: let line = CAShapeLayer() line.path = UIBezierPath(arcCenter: center, radius: radius, startAngle: CGFloat(114.0/180.0) * .pi, endAngle: .pi, clockwise: true...
Lianeliang asked 13/2, 2018 at 11:8

5

In Mac OS X, every display gets a unique CGDirectDisplayID number assigned to it. You can use CGGetActiveDisplayList() or [NSScreen screens] to access them, among others. Per Apple's docs: A dis...
Atomics asked 18/5, 2010 at 23:26

4

I have two bezier paths that i'd like to combine to form a union, so that I can stroke the entire outer shape. In my case, it's a speech bubble with a tail, so although it's not a complex shape it ...
Hitch asked 4/10, 2013 at 9:55

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

9

Solved

With the code below, I am successfully masking part of my drawing, but it's the inverse of what I want masked. This masks the inner portion of the drawing, where I would like to mask the outer port...
Cryptozoic asked 19/1, 2013 at 6:23

2

Solved

I am drawing a simple path in iOS 5 with Core Graphics: CGMutablePathRef path = CGPathCreateMutable(); CGPathMoveToPoint( path, NULL, center.x , topMargin ); CGPathAddLineToPoint(path, NULL, cente...
Fernandofernas asked 17/11, 2011 at 16:27

3

Solved

Take a look at this code: - (void)drawRect:(CGRect)rect { [super drawRect:rect]; CGContextRef context = UIGraphicsGetCurrentContext(); CGSize myShadowOffset = CGSizeMake (-10, 15); CGContex...
Parole asked 27/3, 2014 at 13:20

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

4

Solved

I have a UIBezierPath inside my custom UIView draw(_ rect: CGRect) function. I would like to fill the path with a gradient color. Please can anybody guide me how can I do that. I need to fill the ...
Kittenish asked 3/1, 2017 at 6:22

2

Solved

I realize that the contentsRect property of CALayer (documentation here) allows one to define how much of the layer to use for drawing, but I do not understand how the coordinate system works, I th...
Seamaid asked 12/4, 2012 at 5:15

4

I need to draw centered text to a CGContext. I started with a Cocoa approach. I created a NSCell with the text and tried to draw it thus: NSGraphicsContext* newCtx = [NSGraphicsContext graphicsC...
Lengthwise asked 8/12, 2010 at 10:19

2

Solved

In my app, I would like to present a transparent UIView (or layer) which acts as a color filter. So, when this view is presented everything below, it is shown in grayscale. Is this possible, and i...
Multipartite asked 3/3, 2016 at 9:48

2

Solved

Using standard APIs available on iOS 9 and later, how can I achieve a warp effect (something like the following image) when drawing text? How I would imagine this might work is by specifying ess...
Seely asked 9/6, 2014 at 21:49

© 2022 - 2024 — McMap. All rights reserved.