登录
  • 欢迎访问Sharezer Blog

标签:Swift

IOS

使用NSBezierPath在NSImageView中画线

if captureFilePath != nil{ let image: NSImage = getImageFromURL(url: captureFilePath!)! image.lockFocus() NSColor.white.setStroke() let height: Int = Int(image.size.height) let width: Int = Int(image.size.width) let lineWidth = CGFloat(height > width ? h……继续阅读 »

IOS

保存NSImage到文件

@IBAction func SaveImage(_ sender: Any) { if resuleImage.image != nil { let savePanel = NSSavePanel.init() savePanel.allowedFileTypes = [(captureFilePath?.pathExtension)!] savePanel.message = "Choose the path to save the image" savePanel.isExtensionHidden = false ……继续阅读 »