Sunday, December 29, 2013

How to save a picture synthesis NSString and UIImage

If that please help, thank you
Reply:
The reply was deleted on 2011-04-19 16:48:14 moderator

Reply:
UIImage turn into NSData, re-use base64 encoded turn into a string
Plus a defined structure or class
typedef struct
{
NSString * yourStr;
NSString * imgBase64;
} YourStructName;

I do not know the answer is not what you want?
Reply:
reference to the second floor xuanner reply:
UIImage turn into NSData, re-use base64 encoded turn into a string
Plus a defined structure or class
typedef struct
{
NSString * yourStr;
NSString * imgBase64;
} YourStructName;

I do not know the answer is not what you want?


Thank you very much for your answer, you are the picture turn into a string of my consciousness is how to define a string onto a synthesis of existing images?
Reply:
First image drawn to the screen, and then draw the string to the screen, and then save
[Self setNeedsDisplay] ;/ / use this method, the system will perform the following method
- (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];
}
Then ⋯ ⋯
Save
http://www.cocoachina.com/macdev/cocoa/2009/0611/69.html
Reply:
references, 4th Floor ybh37 reply:
first image drawn to the screen, and then draw the string to the screen, and then save
[Self setNeedsDisplay] ;/ / use this method, the system will perform the following method
- (Void) drawRect: (CGRect) rect
{
if (! self.points) return;
if (self.points.count <2) return;

CGContextRef context = UI ......

You mean with screenshots have ways to achieve? Right!
Reply:
The landlord can not understand for what purpose and to do this, is to fight the fight, but fight on UIImage binary NSString, then this is not a picture, but to your custom data format, with a picture preview is not apparent picture The.
Nothing more than to save the data. . . . Why do you bother it. Written inconvenient, it is not easy to read.
Reply:
reference to the 6th floor xuanner reply:
landlord does not understand for what purpose and to do this, is to fight the fight, but fight on UIImage binary NSString, then This is not a picture of, but you kind of custom data format, with a picture preview can not see out of the picture.
Nothing more than to save the data. . . . Why do you bother it. Written inconvenient, it is not easy to read.

Demand is so, then the time cell phone camera integrated into the picture, at the time of image fusion sent to the server
Reply:
The landlord is obviously wrong idea began, the cell phone camera time, camera type, etc. of the data has been written to automatically when taking pictures, as long as the server side of this photograph reads attributes (EXIF, TIFF information) on can. As for the server is what language, it is necessary to read the specific language.

This is an example of code to achieve 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}"]; 


This is what I read out of the picture display JSON information are EXIF ​​TIFF information,

 "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"
}
],

Reply:
First image drawn to the screen, and then draw the string to the screen, and then save

Positive Solutions
Reply:
When
clear idea began landlord is wrong, the cell phone camera time, camera type, etc. of the data has to take pictures:
reference to the 8th floor xuanner reply automatically write the picture, as long as the server side of this photograph reads attributes (EXIF, TIFF information) on it. As for the server is what language, it is necessary to read the specific language.

This is an example of code to achieve object c:

C / C + + code
NSData * imageData = [NSData dataWithContentsOfFile: i ......


My aim is the integration of time trying to photograph!
Reply:
Canon seems to have been engaged in this, there is distortion, the landlord must be mentally prepared.
The basic approach is to turn into intermediate storage jpeg format on Windows can be a bitmap, then the bitmap drawing functions written with time, after converted to jpeg.

jpeg library is readily available online look official, with c language.
Reply:
LZ is to increase the time a watermark on the image, you got it wrong.

When
clear idea began landlord is wrong, the cell phone camera time, camera type, etc. of the data has to take pictures:
reference to the 8th floor xuanner reply automatically write the picture, as long as the server side of this photograph reads attributes (EXIF, TIFF information) on it. As for the server is what language, it is necessary to read the specific language.

This is an example of code to achieve object c:
C / C + + code
NSData * imageData = [NSData dataWithContentsOfFile: im ......

Reply:
references, 5th Floor zytkwlh reply:
references, 4th Floor ybh37 reply:
First image drawn to the screen, and then draw the string to the screen, and then save
[Self setNeedsDisplay] ;/ / use this method, the system will perform the following method
- (Void) drawRect: (CGRect) rect
{
if (! self.points) return;
if (self.points.count <2) return;

CGCon ......

Direct merge algorithm seemingly not disclosed, and this needs to ¥
Reply:
reference to the 12th floor brucenan999 reply:
LZ is to increase the time on the picture watermark, you got it wrong.


References to the 8th floor xuanner reply:

The landlord is obviously wrong idea began, the cell phone camera time, camera type, etc. of the data has been written to automatically when taking pictures, as long as the server side of this photograph reads attributes (EXIF, TIFF information) on can. As for the server is what language, it is necessary to read the specific language.

This is an example of code to achieve object c:
C / C + + code
NSDat ......


I just want to add time on the picture watermark, headache really have no idea to realize, I hope you can give suggestions
Reply:
reference to the 14th floor zytkwlh reply:
reference to the 12th floor brucenan999 reply:
LZ is to increase the time a watermark on the image, you got it wrong.


References to the 8th floor xuanner reply:

The landlord is obviously wrong idea began, the cell phone camera time, camera type, etc. of the data has been written to automatically when taking pictures, as long as the server side of this photograph reads attributes (EXIF, TIFF information) on can. As for the server is what language, it is necessary to read the specific language.

This is the object c ......

Le
help PengjiayuHe should have thought
Iphone is similar with GDI Win, and you brought changed
Reply:
The reply was deleted at 2011-04-27 14:00:44 moderator

No comments:

Post a Comment