Skip to content
This repository has been archived by the owner on Oct 9, 2021. It is now read-only.

Commit

Permalink
Release SealTalk Demo version 1.1.10
Browse files Browse the repository at this point in the history
  • Loading branch information
RongRobot committed Dec 19, 2016
1 parent db0d4a3 commit aa0c630
Show file tree
Hide file tree
Showing 41 changed files with 1,221 additions and 207 deletions.
2 changes: 1 addition & 1 deletion ios-rongimdemo/RCDAboutRongCloudTableViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ - (NSArray *)urls {
if (!_urls) {
NSArray *section0 =
[NSArray arrayWithObjects:@"http://rongcloud.cn/",
@"http://www.rongcloud.cn/changelog",
@"http://blog.rongcloud.cn/?page_id=1569",
@"http://rongcloud.cn/features",
@"http://rongcloud.cn/", nil];
_urls = [NSArray arrayWithObjects:section0, nil];
Expand Down
31 changes: 19 additions & 12 deletions ios-rongimdemo/RCDCreateGroupViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -435,18 +435,11 @@ - (void)imagePickerController:(UIImagePickerController *)picker

if ([mediaType isEqual:@"public.image"]) {
UIImage *originImage =
[info objectForKey:UIImagePickerControllerOriginalImage];

UIImage *scaleImage = [self scaleImage:originImage toScale:0.8];

// if (UIImagePNGRepresentation(scaleImage) == nil)
// {
// data = UIImageJPEGRepresentation(scaleImage, 0.00001);
// }
// else
// {
// data = UIImagePNGRepresentation(scaleImage);
// }
[info objectForKey:UIImagePickerControllerOriginalImage];
CGRect captureRect = [[info objectForKey:UIImagePickerControllerCropRect] CGRectValue];
UIImage *captureImage = [self getSubImage:originImage Rect:captureRect];

UIImage *scaleImage = [self scaleImage:captureImage toScale:0.8];
data = UIImageJPEGRepresentation(scaleImage, 0.00001);
}

Expand All @@ -457,6 +450,20 @@ - (void)imagePickerController:(UIImagePickerController *)picker
});
}

-(UIImage*)getSubImage:(UIImage *)originImage Rect:(CGRect)rect
{
CGImageRef subImageRef = CGImageCreateWithImageInRect(originImage.CGImage, rect);
CGRect smallBounds = CGRectMake(0, 0, CGImageGetWidth(subImageRef), CGImageGetHeight(subImageRef));

UIGraphicsBeginImageContext(smallBounds.size);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextDrawImage(context, smallBounds, subImageRef);
UIImage* smallImage = [UIImage imageWithCGImage:subImageRef];
UIGraphicsEndImageContext();

return smallImage;
}

- (UIImage *)scaleImage:(UIImage *)Image toScale:(float)scaleSize {
UIGraphicsBeginImageContext(
CGSizeMake(Image.size.width * scaleSize, Image.size.height * scaleSize));
Expand Down
22 changes: 19 additions & 3 deletions ios-rongimdemo/RCDGroupSettingsTableViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -390,9 +390,11 @@ - (void)imagePickerController:(UIImagePickerController *)picker

if ([mediaType isEqual:@"public.image"]) {
UIImage *originImage =
[info objectForKey:UIImagePickerControllerOriginalImage];

UIImage *scaleImage = [self scaleImage:originImage toScale:0.8];
[info objectForKey:UIImagePickerControllerOriginalImage];
CGRect captureRect = [[info objectForKey:UIImagePickerControllerCropRect] CGRectValue];
UIImage *captureImage = [self getSubImage:originImage Rect:captureRect];

UIImage *scaleImage = [self scaleImage:captureImage toScale:0.8];
data = UIImageJPEGRepresentation(scaleImage, 0.00001);
}

Expand Down Expand Up @@ -463,6 +465,20 @@ - (void)imagePickerController:(UIImagePickerController *)picker
});
}

-(UIImage*)getSubImage:(UIImage *)originImage Rect:(CGRect)rect
{
CGImageRef subImageRef = CGImageCreateWithImageInRect(originImage.CGImage, rect);
CGRect smallBounds = CGRectMake(0, 0, CGImageGetWidth(subImageRef), CGImageGetHeight(subImageRef));

UIGraphicsBeginImageContext(smallBounds.size);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextDrawImage(context, smallBounds, subImageRef);
UIImage* smallImage = [UIImage imageWithCGImage:subImageRef];
UIGraphicsEndImageContext();

return smallImage;
}

- (UIImage *)scaleImage:(UIImage *)Image toScale:(float)scaleSize {
UIGraphicsBeginImageContext(
CGSizeMake(Image.size.width * scaleSize, Image.size.height * scaleSize));
Expand Down
14 changes: 14 additions & 0 deletions ios-rongimdemo/RCDSettingServerUrlViewController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// RCDSetttingServerUrlViewController.h
// RCloudMessage
//
// Created by Sin on 16/9/21.
// Copyright © 2016年 RongCloud. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "RCAnimatedImagesView.h"

@interface RCDSettingServerUrlViewController : UIViewController <RCAnimatedImagesViewDelegate>

@end
Loading

0 comments on commit aa0c630

Please sign in to comment.