This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// swift | |
var image = xxx | |
var rect = NSRect(x: 0, y: 0, width: image.size.width, height: image.size.height) | |
let cgImage = image.CGImageForProposedRect(&rect, context: nil, hints: nil)!.takeUnretainedValue() | |
let bitmapRep = NSBitmapImageRep(CGImage: cgImage) | |
if let imageData = bitmapRep.representationUsingType(NSBitmapImageFileType.NSPNGFileType, properties: [:]) { | |
let len = imageData.length | |
var bytes = [UInt8](count: len, repeatedValue: 0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Stack.m | |
// | |
// Created by Joshua Howland on 6/12/14. | |
// Copyright (c) 2014 DevMountain. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
@import CoreData; |