quartz-2d

Drawing an angle/angular/“Conical”/“Arcing” gradient in Objective-C (IOS) using Core Graphics

无人久伴 提交于 2019-12-29 07:53:09
问题 I'm trying to draw a "conical"/"arcing" gradient (I don't know what would be the correct term for this) (Photoshop calls it an "angle" gradient —your friendly neighborhood stackoverflow editor) using Objective-C (IOS), pretty much exactly like the image shown in the following thread. After days of googling and searching the internet to no avail, I've decided to ask for help here. A little background on what I'm trying to do. My objective is to create a custom UIView, which is circular

eraser not working in iOS drawing

痞子三分冷 提交于 2019-12-28 03:10:07
问题 I am working on a drawing project, where I have an eraser option. The code given below is for when I start my app and draw some lines and the proceed to use the eraser. It works fine and I get the eraser effect. Now the second scenario is where I draw some 10 lines and then click on the "undo button" and undo the whole thing, then I redo the whole thing, and now when I click on the "eraser button" and try to erase some part, but instead, it will clear the whole drawing. This is what I am

coregraphics on gnustep ubuntu

依然范特西╮ 提交于 2019-12-25 10:55:47
问题 so im thinking about porting some logic written for my ios app to the server. I am building a view hierachy and then rasterizing it to bitmaps I have used chameleon to successfully port the relevant bits to mac os. and now I would like to try porting this to ubuntu using since GNUstep has an open implementation on AppKit. I managed to get the hello world app working. However, It seemed strange to me than the following throws errors on compiling. #import <Foundation/Foundation.h> #import

how to render svg file in iphone and ipad

浪子不回头ぞ 提交于 2019-12-25 04:47:19
问题 i wrote code to display any type of file like pdf,svg,etc.But unfortunately my code is working with only pdf.the code is like this -(void)drawRect : (CGRect)rect { CGPDFPageRef myPage; NSString * pathToPdfDoc = [[NSBundle mainBundle] pathForResource:@ "pdfdoc" ofType:@ "pdf"]; NSURL * pdfUrl = [NSURL fileURLWithPath:pathToPdfDoc]; // NSLog(@"%@",pdfUrl); CGPDFContentStreamRef myContentStream; document = CGPDFDocumentCreateWithURL((CFURLRef)pdfUrl); // NSLog(@"%@",[document description]); if

Need help understanding to create a mind mapping or flow charting app [closed]

情到浓时终转凉″ 提交于 2019-12-25 03:58:22
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 years ago . I want to create a mind mapping like app in iOS, but not sure how I am suppose to do that there are several questions in mind. Should I use quartz2d? How quartz2d will manage dynamic drawing placing, like if I want to move something then lines or connections will move accordingly.

Unable to Release Quartz 2D and Core Text created Images

若如初见. 提交于 2019-12-24 21:15:41
问题 I am having a problem deleting my OpenGL ES textures are created via Quartz 2D and Core Text as shown below : - (void)drawText:(CGContextRef)contextP startX:(float)x startY:(float) y withText:(NSString *)standString { CGContextTranslateCTM(contextP, 0, (bottom-top)*2); CGContextScaleCTM(contextP, 1.0, -1.0); CGRect frameText = CGRectMake(1, 0, (right-left)*2, (bottom-top)*2); NSMutableAttributedString * attrString = [[NSMutableAttributedString alloc] initWithString:standString]; [attrString

Image is rotated 90 degrees when using clipToMask

一世执手 提交于 2019-12-23 04:45:43
问题 I am trying to clip a portion of an image I take with a camera. Here's my clipping code: - (UIImage*) maskImage:(UIImage *)image { CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); UIImage *maskImage = [UIImage imageNamed:@"mask3.png"]; CGImageRef maskImageRef = [maskImage CGImage]; // create a bitmap graphics context the size of the image CGContextRef mainViewContentContext = CGBitmapContextCreate (NULL, maskImage.size.width, maskImage.size.height, 8, 0, colorSpace,

In CoreGraphics drawing how can I keep the point of overlap from being darker than the rest of the line?

拟墨画扇 提交于 2019-12-22 09:02:05
问题 My app uses core graphics for custom finger paint drawing. I allow the user to change the alpha of the line and a new line is continuously drawn on touches moved. When I make the alpha lower than 1.0 the point of overlap is darker than the rest of the line. I know why this occurs but how can I stop this? 回答1: I suppose you want a single stroke not to darken itself, but still to darken previous strokes (that's how most painting apps work). For this to work, you need two views/buffers, one for

UIGraphicsBeginPDFPage() randomly crashes on 64bit devices (CGPDFSecurityManagerCreateDecryptor ())

故事扮演 提交于 2019-12-22 06:02:44
问题 I'm struggling with a pdf export method that's was running just fine until I ported the app to the arm64 achitecture. Bacisally, the method opens an existing PDF, it creates a new pdf file, and draws the content of the first pdf into the newly created one before adding more content pages. When the method tries to create a new pdf page to the document (after the first pdf was integrated to the new pdf) the app crashes with a EXC_BAD_ACCESS warning on UIGraphicsBeginPDFPage(); call . It only

Can you animate gradients using Quartz in an iPhone?

人走茶凉 提交于 2019-12-21 20:27:53
问题 I am new to iPhone development and am currently toying with recreating a charting tool I developed for Silverlight. Currently I'm using a gradient to 'fill' a rectangle representing a bar within a chart. Is it possible to animate this gradient so it changes colour when a user touches the bar within the chart. I have looked through the Core Animation guides provided by Apple but cannot see a property which targets gradients. I suppose I could use a transition to fade between two rects, one of