quartz-graphics

How to remove black edge on UIImageView with rounded corners and a border width?

懵懂的女人 提交于 2019-11-28 10:14:59
I have the following code to make the UIImageView in each of my UITableView's cells have rounded corners: - (void)awakeFromNib { // Rounded corners. [[cellImage layer] setCornerRadius:([cellImage frame].size.height / 2)]; [[cellImage layer] setMasksToBounds:YES]; [[cellImage layer] setBorderColor:[[UIColor whiteColor] CGColor]]; [[cellImage layer] setBorderWidth:3]; // Trouble! } I want the images to have a bit of a gap between them, and figured I could make use of the border width to make that happen. Below is an image of what actually happened: It's that faint black border that I want to

How can I get screenshot from all displays on MAC?

℡╲_俬逩灬. 提交于 2019-11-28 06:40:20
问题 I try to get the screenshot from all monitors connected with my MAC to one picture. I know, how I can do this if every monitor's screenshot will saved to different pictures, but it is not what I want. I found function CGGetDisplaysWithRect , but my solution don't work, because output picture is empty. I expect, that problem with function CGDisplayCreateImageForRect (*displays, rect), because first parameter must be CGDirectDisplayID type, but not CGDirectDisplayID*. But I can't find function,

Adding glow effect to UIButton - iOS

雨燕双飞 提交于 2019-11-28 05:02:33
I have an UIButton which is a logo. This logo button will glow on forever but will stop glowing on touch.It is like a glowing animation. Is there any suggestions? Undefined symbols for architecture i386: "_OBJC_CLASS_$_CABasicAnimation", referenced from: objc-class-ref in UIView+Glow.o "_OBJC_CLASS_$_CAMediaTimingFunction", referenced from: objc-class-ref in UIView+Glow.o "_kCAMediaTimingFunctionEaseInEaseOut", referenced from: -[UIView(Glow) startGlowing] in UIView+Glow.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see

What are some great Quartz 2D drawing tutorials? [closed]

寵の児 提交于 2019-11-28 03:12:35
I'm searching for some great Quartz 2D drawing tutorials aimed at the iPhone. I'm new to Quartz and want to start off with something easy and then progress to more difficult stuff. Does anyone know of any Quartz 2D drawing tutorials that they would recommend? Brad Larson I devoted an entire class to Quartz 2D drawing last semester in my advanced iPhone development course. The video for that is available on iTunes U , along with the rest of the class. The course notes for that session can be found here , and I created a sample application to show off some more advanced Quartz drawing concepts.

drawRect circle and animate size/color

时光毁灭记忆、已成空白 提交于 2019-11-28 02:57:52
I am drawing a circle in the -drawRect: method of my UIView using the standard CGContextFillEllipseInRect() code. However, I would like to slightly pulse (make larger and smaller) and change the intensity of the color fill with an animation. For example, if the circle is filled with red I would like to pulse the circle and make the red slightly lighter and darker in-time with the pulsing action. Not having much experience with Core Animation I am a bit lost about how to do this, so any help would be greatly appreciated. This is much simpler if you don't draw the circle in drawRect: . Instead,

CGColorGetComponents() not returning the correct values for black and for white

拜拜、爱过 提交于 2019-11-28 01:46:09
Has anyone experienced this problem? It looks like a bug in Apple's code and I will submit a radar if people agree that this code should do what I think it should do. I'm not all that familiar with CoreGraphics color management, hence I'm asking before I bug Apple with a bug report. This is straight out of a template project and the only non-template code is what you see below. Note that the red, green, and blue colors all show the correct component values but not white or black. The problem persists if you change the order with, say, black and white first, then red, green, blue. This is Swift

iPhone: why isn't drawRect getting called?

我是研究僧i 提交于 2019-11-28 01:32:55
问题 Okay, I guess I'm missing something important, and I can't seem to find the answer. I'm posting all the code, because it's very small. Can someone please tell me what I'm doing wrong? I've worked on this looking at example after example, for quite a while, and nothing I do seems to work. When I create the app, I use whichever skeleton gives me a UIViewController. I put a view onto the controller. I create the variables to link into the controller. When I try to connect the UIView in my nib to

Cannot create PDF document with 400+ pages on iOS

北城以北 提交于 2019-11-27 22:52:48
I am using the following pseudocode to generate a PDF document: CGContextRef context = CGPDFContextCreateWithURL(url, &rect, NULL); for (int i = 1; i <= N; i++) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; CGContextBeginPage(context, &mediaBox); // drawing code CGContextEndPage(context); [pool release]; } CGContextRelease(context); It works very well with small documents ( N < 100 pages), but it uses too much memory and crashes if the document has more than about 400 pages (it received two memory warnings before crashing.) I have made sure there were no leaks using Instruments

Drawing path by Bezier curves

℡╲_俬逩灬. 提交于 2019-11-27 20:56:42
I have a task - draw smooth curve input: set of points (they added in realtime) current solution: I use each 4 points to draw qubic Bezier curve (1 - strart, 2 and 3rd - control points, 4- end). End point of each curve is start point for the next one. problem: at the curves connection I often have "fracture" (angle) Can you tell me, how to connect my points more smooth? Thanks! Lukas Šalkauskas Here is few references which can help you: Draw a Smooth Curve through a Set of 2D Points with Bezier Primitives Curve fitting Line Smoothing and point-weeding 来源: https://stackoverflow.com/questions

Is it possible to alter the letter-spacing/kerning of a font with Cocoa Touch?

孤人 提交于 2019-11-27 20:34:28
问题 I've been scouring the Internet for a while now for information on how one can alter the letter-spacing/kerning of a font within UIKit. My fear is, that like using your own custom fonts, you simply can't. Which would be terrible news. I know Apple is protecting us from bad design with these constraints, but they're also preventing us from implementing really great design too. What do people suggest I do? Use the font with the standard kerning, people probably wouldn't notice the difference