• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/pyobjc-42/pyobjc/pyobjc-framework-Quartz/Examples/Programming with Quartz/BasicDrawing/

Lines Matching refs:context

16 def createTrianglePath(context):
17 CGContextBeginPath(context)
18 CGContextMoveToPoint(context, 0, 0)
19 CGContextAddLineToPoint(context, 50, 0)
20 CGContextAddLineToPoint(context, 25, 50)
21 CGContextClosePath(context)
23 def drawSimpleShadow(context):
26 CGContextTranslateCTM(context, 20, 300)
36 # Set the shadow in the context.
37 CGContextSetShadow(context, offset, blur)
41 CGContextFillRect(context, r)
44 CGContextTranslateCTM(context, 150, 0)
48 CGContextSetShadow(context, offset, blur)
51 CGContextBeginPath(context)
52 Utilities.myCGContextAddEllipseInRect(context, r)
53 CGContextFillPath(context)
56 CGContextTranslateCTM(context, -130, -140)
58 # is in the base space of the context. Typically it looks best if the shapes
61 CGContextScaleCTM(context, 2, 2)
62 createTrianglePath(context)
63 CGContextSetStrokeColorWithColor(context, Utilities.getRGBOpaqueRedColor())
65 CGContextSetLineWidth(context, 5)
67 CGContextStrokePath(context)
70 CGContextTranslateCTM(context, 75, 0)
71 createTrianglePath(context)
82 CGContextSetShadowWithColor(context, offset, blur, shadowColor)
83 CGContextStrokePath(context)
86 CGContextTranslateCTM(context, -75, -65)
93 CGContextSetShadow(context, offset, blur)
95 CGContextBeginPath(context)
96 CGContextSetLineWidth(context, 3)
98 Utilities.myCGContextAddEllipseInRect(context, r)
100 Utilities.myCGContextAddEllipseInRect(context, r)
102 Utilities.myCGContextAddEllipseInRect(context, r)
103 CGContextStrokePath(context)
106 def doShadowScaling(context):
110 CGContextTranslateCTM(context, 20, 220)
111 CGContextSetShadow(context, scaleShadowOffset(offset), blur)
115 createTrianglePath(context)
116 CGContextFillPath(context)
122 CGContextConcatCTM(context, t)
123 CGContextTranslateCTM(context, 40, 0)
124 createTrianglePath(context)
125 CGContextFillPath(context)
131 CGContextSetShadow(context, scaleShadowOffset(offset), blur)
132 CGContextTranslateCTM(context, 70, 0)
133 createTrianglePath(context)
134 CGContextFillPath(context)
137 def drawFillAndStrokeWithShadow(context):
143 CGContextSetShadow(context, scaleShadowOffset(offset), blur)
145 CGContextSetFillColorWithColor(context, Utilities.getRGBOpaqueOrangeColor())
148 CGContextBeginPath(context)
149 Utilities.myCGContextAddEllipseInRect(context, r)
150 CGContextDrawPath(context, kCGPathFillStroke)
155 CGContextBeginTransparencyLayer(context, None)
157 Utilities.myCGContextAddEllipseInRect(context, r)
158 CGContextDrawPath(context, kCGPathFillStroke)
160 CGContextEndTransparencyLayer(context)
162 def drawColoredLogo(context):
164 CGContextSaveGState(context)
167 CGContextTranslateCTM(context, 140, 140)
170 CGContextRotateCTM(context, Utilities.DEGREES_TO_RADIANS(45))
172 CGContextTranslateCTM(context,
175 CGContextSetFillColorWithColor(context,
178 CGContextFillRect(context, r)
180 CGContextTranslateCTM(context, 60, -60)
182 CGContextSetFillColorWithColor(context,
184 CGContextFillRect(context, r)
187 CGContextTranslateCTM(context, -30, +30)
189 CGContextSetStrokeColorWithColor(context,
192 CGContextStrokeRectWithWidth(context, r, 12)
193 CGContextRestoreGState(context)
195 def showComplexShadowIssues(context):
200 CGContextSetShadow(context, scaleShadowOffset(offset), blur)
202 drawColoredLogo(context)
204 def showComplexShadow(context):
209 CGContextSetShadow(context, scaleShadowOffset(offset), blur)
218 # drawing to the context, using the global alpha, blend mode, and shadow
221 CGContextBeginTransparencyLayer(context, None)
223 drawColoredLogo(context)
233 CGContextEndTransparencyLayer(context)
235 def doLayerCompositing(context):
238 CGContextTranslateCTM(context, 20, 20)
239 CGContextSetFillColorWithColor(context, Utilities.getRGBOpaqueGreenColor())
241 CGContextFillRect(context, r)
243 drawColoredLogo(context)
246 CGContextTranslateCTM(context, 300, 0)
247 CGContextSetFillColorWithColor(context, Utilities.getRGBOpaqueGreenColor())
249 CGContextFillRect(context, r)
252 CGContextSetAlpha(context, 0.75)
254 drawColoredLogo(context)
257 CGContextTranslateCTM(context, 300, 0)
259 CGContextSetAlpha(context, 1.0)
260 CGContextSetFillColorWithColor(context, Utilities.getRGBOpaqueGreenColor())
261 CGContextFillRect(context, r)
263 CGContextSetAlpha(context, 0.75)
267 CGContextBeginTransparencyLayer(context, None)
270 drawColoredLogo(context)
275 CGContextEndTransparencyLayer(context)
277 def shadowPDFDocument(context, url):
290 CGContextSetShadow(context, scaleShadowOffset(offset), 3)
298 CGContextBeginTransparencyLayer(context, None)
300 CGContextDrawPDFDocument(context, r, pdfDoc, 1)
302 CGContextEndTransparencyLayer(context)