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
#define UPDATE_ORIENTATION_NOTI CFSTR("iolate/UpdateOrientation") | |
static UIWindow* additionalWindow = nil; | |
static UIView* mainViewInWindow = nil; | |
static void updateOrientation(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo) { | |
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation; | |
int orientation_ = 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
UIWebClip *clip = [UIWebClip webClipWithIdentifier:nil]; | |
//UIWebClip *clip = [UIWebClip webClipWithURL:[webpage.request.mainDocumentURL absoluteString]]; | |
[clip retain]; | |
[clip setPageURL:webpage.request.mainDocumentURL]; | |
[clip setTitle:[webpage stringByEvaluatingJavaScriptFromString:@"document.title"]]; | |
UIWebDocumentView *docView = nil; | |
UIScrollView *webpagescroller = [[webpage subviews] objectAtIndex:0]; | |
for (UIView* aView in [webpagescroller subviews]){ | |
if ([aView isKindOfClass:[NSClassFromString(@"UIWebBrowserView") class]]){ | |
docView = (UIWebDocumentView *)aView; |
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
- (UIImage *)imageRotatedByDegrees:(CGFloat)degrees image:(UIImage*)image | |
{ | |
// calculate the size of the rotated view's containing box for our drawing space | |
UIView *rotatedViewBox = [[UIView alloc] initWithFrame:CGRectMake(0,0,image.size.width, image.size.height)]; | |
CGAffineTransform t = CGAffineTransformMakeRotation(DegreesToRadians(degrees)); | |
rotatedViewBox.transform = t; | |
CGSize rotatedSize = rotatedViewBox.frame.size; | |
[rotatedViewBox release]; | |
// Create the bitmap context |