quartz-graphics

iPhone + Quartz: How to get a water effect

风格不统一 提交于 2019-12-19 04:56:17
问题 ist there any chance to build a water effect with Quartz on the iPhone? Something similar to this one: alt text http://img37.imageshack.us/img37/6358/bild1wbm.png 回答1: For that, I highly recommend using OpenGL ES . Despite the "simplicity" of the problem you addressed in this SO question, I recommended OpenGL ES then as well. So, you can imagine why I'm advising it again. Check this SO question for the water effect with OpenGL. 来源: https://stackoverflow.com/questions/927714/iphone-quartz-how

water effect in cocos2d

*爱你&永不变心* 提交于 2019-12-18 11:37:01
问题 I'd like to have a water effect on a background layer in my app. The effect doesn't need to react to touch or anything - it just needs to wave an image a little bit. CCWaves3D seem ok, but leave have nasty black artifacts around the edges when I run it. Similarly CCShaky3D. CCLiquid brings my app down from 20fps to 5fps.. Is there any other effect I might want to try out? Or perhaps I'm using the current effects in a wrong way? id shaky = [CCShaky3D actionWithRange:4 shakeZ:NO grid:ccg(15,10)

(Scale) Zoom into a UIView at a point

雨燕双飞 提交于 2019-12-18 10:16:26
问题 Something I don't understand about transformations. I want to zoom in to say the top right corner of a UIView (the main view). I use CGAffineTransformScale and have tried both setting the center/anchorPoint as well as CGAffineTransformMakeTranslation to no avail. I can't figure out how to set the translation properly so that it will zoom in on this point. CGAffineTransform tr = CGAffineTransformScale(self.view.transform, 2, 2); [UIView animateWithDuration:2.5 delay:0 options:0 animations:^{

Mac OS X: Can one process render to another process's window?

試著忘記壹切 提交于 2019-12-18 10:14:19
问题 Greetings! I'm currently porting a web browser plugin from Win32 to MacOSX. One of the features of the plugin is that when the plugin is loaded, it spawns a separate process that serves as the "engine" of the plugin and executes drawing operations into the window of the plugin (specifically, by attaching an OpenGL context to the parent process's window and executing OpenGL rendering commands into that context). We do this because the plugin is typically loaded as a thread within the browser

Creating mask with CGImageMaskCreate is all black (iphone)

大兔子大兔子 提交于 2019-12-18 10:12:02
问题 I'm trying to create an image mask that from a composite of two existing images. First I start with creating the composite which consists of a small image that is the masking image, and a larger image which is the same size as the background: UIImage * BaseTextureImage = [UIImage imageNamed:@"background.png"]; UIImage * MaskImage = [UIImage imageNamed:@"my_mask.jpg"]; UIImage * ShapesBase = [UIImage imageNamed:@"largerimage.jpg"]; UIImage * MaskImageFull; CGSize finalSize = CGSizeMake(480.0,

How do I draw lines with alpha < 1 in quartz 2d

梦想的初衷 提交于 2019-12-18 07:12:19
问题 No doubt this might be a duplicate question but I am not able to get proper solution from any post here. So I am posting this as new post with a hope that I get some solution. I my drawing app I want to give a feature of opacity for lines to be drawn. But when I assign alpha to color, I am getting overlapped points in between the line. Some where I found that drawing in two views solves this issue, but I was not able to understand the logic behind that. I am using normal quartz 2d code to

How do I draw lines with alpha < 1 in quartz 2d

試著忘記壹切 提交于 2019-12-18 07:12:09
问题 No doubt this might be a duplicate question but I am not able to get proper solution from any post here. So I am posting this as new post with a hope that I get some solution. I my drawing app I want to give a feature of opacity for lines to be drawn. But when I assign alpha to color, I am getting overlapped points in between the line. Some where I found that drawing in two views solves this issue, but I was not able to understand the logic behind that. I am using normal quartz 2d code to

setNeedsDisplayInRect bug in iOS5?

一世执手 提交于 2019-12-18 05:22:32
问题 I'm trying to use setNeedsDisplayInRect: in iOS5 to optimize some drawing code. The setup is simple: I have an array of CGRect 'hotspots' that function as buttons. When a touch is detected I find the CGRect it occurred in and call setNeedsDisplayInRect: on the view with that rect as a param. All the CGRects are valid for the view - it uses them to do it's initial drawing and that comes out correctly. What I am seeing (as the Console dump below shows) is that the first call to

How to generate thumbnails from a PDF document with iPhone SDK?

随声附和 提交于 2019-12-17 23:23:44
问题 I have read the Apple PDF documentation with Quartz. But I do not know how to generate the thumbnails from a PDF document... Any idea/sample code ? 回答1: Here is my sample code. NSURL* pdfFileUrl = [NSURL fileURLWithPath:finalPath]; CGPDFDocumentRef pdf = CGPDFDocumentCreateWithURL((CFURLRef)pdfFileUrl); CGPDFPageRef page; CGRect aRect = CGRectMake(0, 0, 70, 100); // thumbnail size UIGraphicsBeginImageContext(aRect.size); CGContextRef context = UIGraphicsGetCurrentContext(); UIImage*

Getting text position while parsing pdf with Quartz 2D

Deadly 提交于 2019-12-17 23:09:48
问题 another question regarding pdf parsing... Just read PDF Reference version 1.7 "5.3.1 Text-Positioning Operators" and I am a little bit confused. I wrote some code to get transformation matrix and initial text position. CGPDFOperatorTableSetCallback (table, "MP", &op_MP);//Define marked-content point CGPDFOperatorTableSetCallback (table, "DP", &op_DP);//Define marked-content point with property list CGPDFOperatorTableSetCallback (table, "BMC", &op_BMC);//Begin marked-content sequence