Skip to content

Instantly share code, notes, and snippets.

@ChristianSch
Last active August 29, 2015 13:56
Show Gist options
  • Save ChristianSch/9295651 to your computer and use it in GitHub Desktop.
Save ChristianSch/9295651 to your computer and use it in GitHub Desktop.
CGFloat width = 300;
CGFloat height = 400;
AIPNGController *pngController = [[AIPNGController alloc] init];
[pngController createBitmapContextWithWidth:width andHeight:height];
[pngController drawLineFrom:CGPointMake(10, 10)
to:CGPointMake(width - 10, 10)];
[pngController drawLineFrom:CGPointMake(width - 10, 10)
to:CGPointMake(width - 10, height * 2 / 3)];
[pngController drawLineFrom:CGPointMake(width - 10, height * 2 / 3)
to:CGPointMake(10, height * 2 / 3)];
[pngController drawLineFrom:CGPointMake(10, height * 2 / 3)
to:CGPointMake(width / 2, height - 10)];
[pngController drawLineFrom:CGPointMake(width / 2, height - 10)
to:CGPointMake(width - 10, height * 2 / 3)];
[pngController drawLineFrom:CGPointMake(width - 10, height * 2 / 3)
to:CGPointMake(10, 10)];
[pngController drawLineFrom:CGPointMake(10, 10)
to:CGPointMake(10, height * 2 / 3)];
[pngController drawLineFrom:CGPointMake(10, height * 2 / 3)
to:CGPointMake(width - 10, 10)];
[pngController
saveImageToPNGWithPath:@"/Users/x/Desktop/Das-Ist-Das-Haus-Vom-Ni-ko-laus.png"];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment