如题请大家帮助,谢谢

解决方案 »

  1.   

    UIImage转成NSData,再利用base64编码转成字符串
    加上一个定义结构体或是类
    typedef struct
    {
        NSString *yourStr;
        NSString *imgBase64;
    } yourStructName;不知是不是你想要的答案?
      

  2.   

    先把image画到屏幕,再把字符串画到屏幕上,然后再保存
    [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
      

  3.   

    不明白楼主出于什么目的而做这个的,拼是可以拼,但UIImage二进制拼上NSString,那么这个就不是图片了,而是你自定义的一种数据格式,用图片预览是看不出来图片的。
    无非就是为了保存数据。何必搞得那么麻烦呢。写入不方便,读取出来也不方便。
      

  4.   

    明显楼主的思路开始就是错误的了,手机拍照的时间,相机类型等的数据已以在拍照时自动写入图片了,只要在服务器那边读取这张照片的属性(EXIF、TIFF信息)就可以了。至于服务器是用什么语言实现的,就要根据具体的语言去读取。这是object c 实现的例子代码:
    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"
          }
        ],
      

  5.   

    先把image画到屏幕,再把字符串画到屏幕上,然后再保存正解
      

  6.   

    佳能一直在搞这个似乎,有失真,楼主要有思想准备。
    基本做法是jpeg转成中间存储格式,在Windows上可以是bitmap,然后在bitmap上用画图函数写时间,之后再转换成jpeg。jpeg库是现成的,到网上找找官方的,是用c语言写的。
      

  7.   

    求救 彭佳乐
    他应该有思路
    Iphone的GDI跟Win的类似,你拿来改改