Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const void* const DataPointer = AvatarQueryIter->get<const void* const>(1);
- autorelease<NSData> Data = [[NSData alloc] initWithBytes:const_cast<void*>(DataPointer) length:Size];
- autorelease<NSImage> Image = [[NSImage alloc] initWithData:Data];
- const CGFloat ImageSize = 50.0;
- const CGFloat XOffset = 3.0;
- const CGFloat YOffset = -1.0;
- [Image setSize:NSMakeSize(ImageSize, ImageSize)];
- NSImage* RImage = [[NSImage alloc] initWithSize:NSMakeSize(ImageSize + fabsf(XOffset), ImageSize + fabsf(YOffset))];
- [NSGraphicsContext saveGraphicsState];
- [RImage lockFocus];
- NSRect rect = NSMakeRect(XOffset, YOffset, ImageSize, ImageSize);
- NSBezierPath* path = [NSBezierPath bezierPathWithRoundedRect:rect xRadius:5 yRadius:5];
- [path addClip];
- [Image drawInRect:rect fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1];
- [RImage unlockFocus];
- [NSGraphicsContext restoreGraphicsState];
- DataSet.avatars[UserID] = RImage;
Add Comment
Please, Sign In to add comment