|
|
|
iOS อยากจะทำแอปเหมือน Sticker อะครับ คือเอาภาพ 2 ภาพมาซ้อนกันแล้ว share |
|
|
|
|
|
|
|
Code (Objective-C)
UIImage *bottomImage = [UIImage imageNamed:@"bottom.png"]; //background image
UIImage *image = [UIImage imageNamed:@"top.png"]; //foreground image
CGSize newSize = CGSizeMake(width, height);
UIGraphicsBeginImageContext( newSize );
// Use existing opacity as is
[bottomImage drawInRect:CGRectMake(0,0,newSize.width,newSize.height)];
// Apply supplied opacity if applicable
[image drawInRect:CGRectMake(0,0,newSize.width,newSize.height) blendMode:kCGBlendModeNormal alpha:0.8];
UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
http://stackoverflow.com/questions/9208951/ios-merging-two-images-of-different-size
http://www.musicalgeometry.com/?p=1681
ลองดูครับ
|
|
|
|
|
Date :
2014-07-01 08:51:29 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 04
|