如题请大家帮助,谢谢
解决方案 »
- objective-c合成存储器问题
- Iphone开发xcode4.0运行书上例子报错Thread 1:Program received signal:"SIGABRT"
- xcode4.2 for lion不知道如何设置
- 请教,我们电脑上设计的东西,放到手机上缩放比例是怎么样的
- 一个tableview怎么对应多个tableviewcell?
- 请问哪里有 不需要付费,使用不侵权的 图标下载吗
- 为什么模拟器有声音,真机上测试就听不到声音了
- IOS下关闭GPS的私有API是哪个函数?
- 急求最新版zbarsdk iphone 32位和64位都能用的
- 大神进来帮忙看看,关于NSString
- Ipad开发 如何在设置里配置应用程序(主要是弹出对话框形式配置)
- 教个问题!关于多个label的显示问题(也可以说是动画效果?)
加上一个定义结构体或是类
typedef struct
{
NSString *yourStr;
NSString *imgBase64;
} yourStructName;不知是不是你想要的答案?
[self setNeedsDisplay];//用这个方法,系统会执行下面的方法
- (void) drawRect: (CGRect) rect
{
if (!self.points) return;
if (self.points.count < 2) return;
CGContextRef context = UIGraphicsGetCurrentContext();
[current set];
CGContextSelectFont (context, // 3
"Arial",
40,
kCGEncodingMacRoman);
UIFont* tfont = [UIFont fontWithName:@"Arial" size:40.0];
CGContextSetCharacterSpacing (context, 10); // 4
CGContextSetTextDrawingMode (context, kCGTextFillStroke); // 5
// CGContextSetRGBFillColor (context, 0, 1, 0, 1.0); // 6
// CGContextSetRGBStrokeColor (context, 0, 0, 1, 1); // 7
// NSString *tstr = @"test";
//
//
// [tstr drawAtPoint:CGPointMake(0.0,0.0) withFont:tfont];
NSString *path = [self pathForItemNamed:@"aa.png" inFolder:[self imageFolderPath:@"Documents"]];
UIImage * img = [UIImage imageWithContentsOfFile:path];
[img drawInRect:CGRectMake(0.0, 0.0, 320, 480)];
NSString*tstr1 = @"1111111111111111111111";
[tstr1 drawInRect:CGRectMake(0.0, 0.0, 320, 480) withFont:tfont];
}
然后⋯⋯
保存
http://www.cocoachina.com/macdev/cocoa/2009/0611/69.html
无非就是为了保存数据。何必搞得那么麻烦呢。写入不方便,读取出来也不方便。
NSData *imageData = [NSData dataWithContentsOfFile:imagePath];CGImageSourceRef source = CGImageSourceCreateWithData((CFDataRef)imageData, NULL); NSDictionary *metaData = (NSDictionary *)CGImageSourceCopyPropertiesAtIndex(source,0,NULL);NSDictionary *exifData = [metaData objectForKey:@"{Exif}"];NSDictionary *tiffData = [metaData objectForKey:@"{TIFF}"];
这是我读取图片显示出来的JSON信息分别是EXIF TIFF信息,"photoFlow" : [
{
"ExposureTime" : 0.01666667,
"MaxApertureValue" : 2.96875,
"Flash" : 89,
"ColorSpace" : 1,
"ExifVersion" : [
2,
2
],
"FocalPlaneYResolution" : 7245.283,
"FocalPlaneResolutionUnit" : 2,
"ShutterSpeedValue" : 5.90625,
"FocalLength" : 7.3,
"CompressedBitsPerPixel" : 2,
"FNumber" : 2.8,
"SceneCaptureType" : 0,
"PixelYDimension" : 1,
"ApertureValue" : 2.96875,
"PixelXDimension" : 1,
"CustomRendered" : 0,
"WhiteBalance" : 0,
"DateTimeDigitized" : "2008:08:23 22:15:01",
"SensingMethod" : 2,
"DateTimeOriginal" : "2008:08:23 22:15:01",
"MeteringMode" : 5,
"FlashPixVersion" : [
1,
0
],
"ComponentsConfiguration" : [
1,
2,
3,
0
],
"ExposureMode" : 0,
"DigitalZoomRatio" : 1,
"ExposureBiasValue" : 0,
"FocalPlaneXResolution" : 7236.749
},
{
"Model" : "Canon PowerShot A610",
"_YCbCrPositioning" : 1,
"ResolutionUnit" : 2,
"YResolution" : 180,
"XResolution" : 180,
"Orientation" : 1,
"DateTime" : "2008:08:23 22:15:01",
"Make" : "Canon"
}
],
基本做法是jpeg转成中间存储格式,在Windows上可以是bitmap,然后在bitmap上用画图函数写时间,之后再转换成jpeg。jpeg库是现成的,到网上找找官方的,是用c语言写的。
他应该有思路
Iphone的GDI跟Win的类似,你拿来改改