当前位置: 首页>>代码示例>>Python>>正文


Python NSColor.colorWithDeviceCyan_magenta_yellow_black_alpha_方法代码示例

本文整理汇总了Python中AppKit.NSColor.colorWithDeviceCyan_magenta_yellow_black_alpha_方法的典型用法代码示例。如果您正苦于以下问题:Python NSColor.colorWithDeviceCyan_magenta_yellow_black_alpha_方法的具体用法?Python NSColor.colorWithDeviceCyan_magenta_yellow_black_alpha_怎么用?Python NSColor.colorWithDeviceCyan_magenta_yellow_black_alpha_使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AppKit.NSColor的用法示例。


在下文中一共展示了NSColor.colorWithDeviceCyan_magenta_yellow_black_alpha_方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: drawline

# 需要导入模块: from AppKit import NSColor [as 别名]
# 或者: from AppKit.NSColor import colorWithDeviceCyan_magenta_yellow_black_alpha_ [as 别名]
def drawline(x1, y1, x2, y2, colour, strokewidth, dashed):

	NSColor.colorWithDeviceCyan_magenta_yellow_black_alpha_(colour[0], colour[1], colour[2], colour[3], 1).set()
	Path = NSBezierPath.bezierPath()
	Path.moveToPoint_((x1, y1))
	Path.lineToPoint_((x2, y2))
	Path.setLineWidth_(strokewidth)
	
	if dashed:
		Path.setLineDash_count_phase_(dashed, 2, 0.0)
	Path.stroke()
开发者ID:schriftgestalt,项目名称:Autopsy-Plugin,代码行数:13,代码来源:AutopsyLib.py

示例2: drawrect

# 需要导入模块: from AppKit import NSColor [as 别名]
# 或者: from AppKit.NSColor import colorWithDeviceCyan_magenta_yellow_black_alpha_ [as 别名]
def drawrect(x1, y1, x2, y2, fillcolour, strokecolour, strokewidth, dashed, rounded):
	Rect = NSMakeRect(x1, y1, x2 - x1, y2 - y1)
	Path = NSBezierPath.bezierPathWithRoundedRect_xRadius_yRadius_(Rect, rounded, rounded)
	if fillcolour:
		NSColor.colorWithDeviceCyan_magenta_yellow_black_alpha_(fillcolour[0], fillcolour[1], fillcolour[2], fillcolour[3], 1).set()
		Path.fill()
	if strokecolour:
		Path.setLineWidth_(strokewidth)
		if dashed:
			Path.setLineDash_count_phase_(dashed, 2, 0.0)
		NSColor.colorWithDeviceCyan_magenta_yellow_black_alpha_(strokecolour[0], strokecolour[1], strokecolour[2], strokecolour[3], 1).set()
		Path.stroke()
开发者ID:schriftgestalt,项目名称:Autopsy-Plugin,代码行数:14,代码来源:AutopsyLib.py

示例3: DrawGlyph

# 需要导入模块: from AppKit import NSColor [as 别名]
# 或者: from AppKit.NSColor import colorWithDeviceCyan_magenta_yellow_black_alpha_ [as 别名]
def DrawGlyph(f, glyph, PSCommands, xoffset, yoffset, ratio, fillcolour, strokecolour, strokewidth, dashed):
	if not PSCommands:
		layer = glyph.layers[0]
		p = layer.drawBezierPath
		transform = NSAffineTransform.new()
		transform.translateXBy_yBy_(xoffset*mm, yoffset*mm)
		transform.scaleBy_(ratio)
		p.transformUsingAffineTransform_(transform)
	else:
		p = NSBezierPath.bezierPath()
		
		for command in PSCommands:
		
			if command[0] == 'moveTo':
				try:
					p.close()
				except:
					pass
	
				x = xoffset*mm + command[1][0] * ratio
				y = yoffset*mm + command[1][1] * ratio
				p.moveToPoint_((x, y))
				#print "('moveTo', (%s, %s))," % (command[1][0], command[1][1])
	
			if command[0] == 'lineTo':
				x = xoffset*mm + command[1][0] * ratio
				y = yoffset*mm + command[1][1] * ratio
				p.lineToPoint_((x, y))
				#print "('lineTo', (%s, %s))," % (command[1][0], command[1][1])
	
			if command[0] == 'curveTo':
	
				points = []
				
				for point in command[1:]:
					points.append( (xoffset*mm + point[0] * ratio, yoffset*mm + point[1] * ratio) )
				
				p.curveToPoint_controlPoint1_controlPoint2_(points[0], points[1], points[2])
		p.closePath()
	
	if fillcolour:
		NSColor.colorWithDeviceCyan_magenta_yellow_black_alpha_(fillcolour[0], fillcolour[1], fillcolour[2], fillcolour[3], 1).set()
		p.fill()
	if strokecolour:
		NSColor.colorWithDeviceCyan_magenta_yellow_black_alpha_(strokecolour[0], strokecolour[1], strokecolour[2], strokecolour[3], 1).set()
		if dashed:
			p.setLineDash_count_phase_(dashed, 2, 0.0)
		p.setLineWidth_(strokewidth)
		p.stroke()
开发者ID:schriftgestalt,项目名称:Autopsy-Plugin,代码行数:51,代码来源:AutopsyLib.py

示例4: DrawTableLines

# 需要导入模块: from AppKit import NSColor [as 别名]
# 或者: from AppKit.NSColor import colorWithDeviceCyan_magenta_yellow_black_alpha_ [as 别名]
def DrawTableLines(list, colour, thickness):
	
	global myDialog
	for i, point in enumerate(list):

		try:
			drawline(list[i][1]*mm, list[i][2]*mm, list[i+1][1]*mm, list[i+1][2]*mm, colour, thickness, None)
		except:
			pass

		NSColor.colorWithDeviceCyan_magenta_yellow_black_alpha_(colour[0], colour[1], colour[2], colour[3], 1).set()
		Rect = NSMakeRect(point[1]*mm-(thickness), point[2]*mm-(thickness), thickness*2, thickness*2)
		NSBezierPath.bezierPathWithOvalInRect_(Rect).fill()
		if Glyphs.boolDefaults["com_yanone_Autopsy_drawpointsvalues"]:
			DrawText(pdffont['Regular'], pointsvaluefontsize, glyphcolour, point[1]*mm + (thickness/6+1)*mm, point[2]*mm - (thickness/6+2.5)*mm, str(int(round(point[0]))))
开发者ID:schriftgestalt,项目名称:Autopsy-Plugin,代码行数:17,代码来源:AutopsyLib.py

示例5: DrawText

# 需要导入模块: from AppKit import NSColor [as 别名]
# 或者: from AppKit.NSColor import colorWithDeviceCyan_magenta_yellow_black_alpha_ [as 别名]
def DrawText(font, fontsize, fontcolour, x, y, text):
	attributes = {NSFontAttributeName : NSFont.fontWithName_size_(font, fontsize), NSForegroundColorAttributeName: NSColor.colorWithDeviceCyan_magenta_yellow_black_alpha_(fontcolour[0], fontcolour[1], fontcolour[2], fontcolour[3], 1)}
	String = NSAttributedString.alloc().initWithString_attributes_(text, attributes)
	String.drawAtPoint_((x, y))
开发者ID:schriftgestalt,项目名称:Autopsy-Plugin,代码行数:6,代码来源:AutopsyLib.py


注:本文中的AppKit.NSColor.colorWithDeviceCyan_magenta_yellow_black_alpha_方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。