http://code.google.com/p/iphonecomic/source/browse/#svn/trunk%3Fstate%3Dclosed
http://code.google.com/p/weisms/downloads/list

动态画按钮 前进 后退
http://outerlevel.com/blog/2008/12/26/code-example-drawing-the-iphone-back-button/
地理定位改變世界的十種方式

各种图像操作
http://www.trembl.org/codec/tag/cgimageref/

http://stackoverflow.com/questions/2475450/extracting-images-from-a-pdf

存储OpenGL ES内容到相片簿
CGImageCreate

http://www.cocoadev.com/index.pl?BaseSixtyFour

#define SCREEN_METRIC_WIDTH 320

#define SCREEN_METRIC_HEIGHT 480
#define BMP_SIZE 320*480*3
#define BMP_HEADER_LENGTH 54

- (CGImageRef) GetImageData
{
unsigned char* pData=NULL;
int i = 0;

int bitsPerComponent = 8;
int bitsPerPixel = 24;
int bytesPerRow = 3 * SCREEN_METRIC_WIDTH;
NSInteger myLCDDataLength =
320 * 480 * 2;
CGColorSpaceRef colorSpaceRef = CGColorSpaceCreateDeviceRGB();
CGBitmapInfo bmpInof = kCGBitmapByteOrderDefault;
CGColorRenderingIntent renderingIntent = kCGRenderingIntentDefault;
CGDataProviderRef provider = nil;
void*pBuffer = malloc(BMP_SIZE + BMP_HEADER_LENGTH);

int s[] = {-1,-40,-1,-32,0,16,74,70,73,70,0,1,1,0,0,1,0,1,0,0,-1,-37,0,67,0,10,7,7,8,7,6,10,8,8,8,11,10,10,11,14,24,16,14,13,13,14,29,21,22,17,24,35,31,37,36,34,31,34,33,38,43,55,47,38,41,52,41,33,34,48,65,49,52,57,59,62,62,62,37,46,68,73,67,60,72,55,61,62,59,-1,-37,0,67,1,10,11,11,14,13,14,28,16,16,28,59,40,34,40,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,-1,-64,0,17,8,0,96,0,96,3,1,34,0,2,17,1,3,17,1,-1,-60,0,31,0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,-1,-60,0,-75,16,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125,1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,-127,-111,-95,8,35,66,-79,-63,21,82,-47,-16,36,51,98,114,-126,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,-125,-124,-123,-122,-121,-120,-119,-118,-110,-109,-108,-107,-106,-105,-104,-103,-102,-94,-93,-92,-91,-90,-89,-88,-87,-86,-78,-77,-76,-75,-74,-73,-72,-71,-70,-62,-61,-60,-59,-58,-57,-56,-55,-54,-46,-45,-44,-43,-42,-41,-40,-39,-38,-31,-30,-29,-28,-27,-26,-25,-24,-23,-22,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-1,-60,0,31,1,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,-1,-60,0,-75,17,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119,0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,-127,8,20,66,-111,-95,-79,-63,9,35,51,82,-16,21,98,114,-47,10,22,36,52,-31,37,-15,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,-126,-125,-124,-123,-122,-121,-120,-119,-118,-110,-109,-108,-107,-106,-105,-104,-103,-102,-94,-93,-92,-91,-90,-89,-88,-87,-86,-78,-77,-76,-75,-74,-73,-72,-71,-70,-62,-61,-60,-59,-58,-57,-56,-55,-54,-46,-45,-44,-43,-42,-41,-40,-39,-38,-30,-29,-28,-27,-26,-25,-24,-23,-22,-14,-13,-12,-11,-10,-9,-8,-7,-6,-1,-38,0,12,3,1,0,2,17,3,17,0,63,0,-15,-35,-92,12,-47,74,14,70,-38,85,82,65,-10,20,8,109,0,113,-102,114,-90,-32,72,-25,-38,-112,46,104,11,-124,71,7,7,-95,-91,35,13,-73,-41,-91,38,14,105,-4,-70,-121,31,120,83,1,-96,-29,24,-21,82,-56,80,-79,32,-25,-25,63,-107,65,-102,92,-110,126,-76,-126,-61,64,-63,-87,-19,-30,50,-72,2,-94,-21,-113,90,-34,-16,-27,-84,79,42,-51,48,-62,43,-14,125,125,-86,101,43,43,-107,21,118,46,-99,-96,73,117,123,12,65,88,-122,-55,-23,-38,-67,35,66,-16,116,86,127,-67,-107,1,101,-7,113,-118,-27,110,-4,94,52,-7,86,13,57,80,50,112,54,-127,-57,-44,-41,127,-31,93,118,125,115,75,73,103,69,87,-24,118,-9,-84,27,111,114,-19,-40,-16,32,112,106,-62,38,-4,14,-101,-114,7,-81,-7,-51,87,21,34,62,-44,4,14,65,-1,0,63,-25,-38,-70,76,-104,-27,14,-104,108,29,-83,-63,-9,-11,-90,46,50,87,-44,-45,-99,-53,-15,-37,57,-57,-42,-94,-17,64,-111,54,-63,-76,31,124,17,77,3,-111,-44,103,-67,51,118,87,6,-92,-36,100,-116,40,-57,20,-125,84,71,-76,-126,70,58,82,85,-56,98,55,17,-99,-85,-105,94,24,31,126,-11,79,20,33,-114,-120,101,-15,-116,-41,69,-93,65,53,-12,-80,-23,118,-60,43,-54,-60,111,60,0,15,83,-11,-19,88,-42,16,-103,101,27,70,91,60,15,90,-10,-33,-121,94,9,-126,-38,20,-44,-82,-94,12,-18,-93,104,35,-91,103,38,-101,-79,-94,-47,92,-13,-3,95,-64,-38,-89,-121,-75,104,-68,-85,121,46,-83,-27,-27,100,-119,75,126,7,-46,-67,7,-31,-57,-121,-75,29,42,11,-127,121,17,-114,41,100,-35,18,55,85,-11,-81,71,17,70,0,1,6,5,52,-57,-5,-48,-40,-32,116,-90,-43,-56,78,-57,-56,52,15,79,90,-46,-121,-61,-38,-35,-52,98,104,52,-117,-23,99,60,-121,75,119,32,-2,56,-86,119,22,-73,54,114,121,87,54,-14,-64,-3,118,-54,-123,79,-28,107,64,32,4,-114,-108,-71,-51,20,14,-108,0,82,-95,-63,-93,28,82,80,5,-101,25,-52,23,73,33,-28,19,-122,7,-67,104,107,122,83,89,72,-73,17,-60,-53,109,115,-52,108,122,102,-78,7,7,61,-115,122,63,-122,33,95,20,120,86,-17,73,-104,-125,42,15,-35,-97,-18,-111,-56,-2,-107,-100,-99,-99,-63,106,96,-8,22,-46,43,-51,102,8,-35,115,-13,-14,5,125,37,105,10,91,-38,-57,18,0,21,84,1,-118,-7,-41,-64,78,116,-17,25,65,109,56,41,-5,-62,-116,8,-2,33,-63,31,-42,-66,-113,76,109,24,-23,-118,81,94,-13,99,-106,-56,90,40,-94,-84,-125,-112,-47,124,109,-3,-73,120,-10,-42,26,83,-108,65,-110,-59,-128,-64,-85,26,-26,-121,97,-30,-101,54,-77,-43,52,-74,-120,-82,74,77,-127,-14,31,80,-61,-91,84,-8,127,-93,73,-93,91,93,65,116,-72,-71,18,97,-114,58,-114,-60,85,-49,29,-33,92,90,120,102,-28,90,-71,73,36,82,-69,-121,80,59,-42,123,70,-20,-42,73,115,114,-60,-15,45,111,-64,119,122,85,-12,-48,68,-58,-30,52,1,-108,-127,-109,-116,-97,-16,63,-89,-83,98,-34,104,-41,22,88,-34,-104,89,62,-23,61,-113,-7,-30,-67,-65,-64,26,37,-53,-24,-10,-38,-122,-94,-19,39,-104,14,-43,-109,-110,19,-73,-14,-85,30,46,-16,117,-75,-18,-104,-2,68,106,-127,7,-54,2,-12,-11,-49,-75,36,-25,107,-119,-91,123,31,58,0,84,-31,-72,-95,6,122,-42,-58,-93,-93,-49,103,116,-48,-80,99,27,49,-40,-19,-2,62,-75,-108,-47,50,62,-42,24,34,-76,82,76,86,24,-54,84,-19,62,-103,-82,-101,-64,-102,-77,105,-34,32,-123,75,-31,38,59,27,61,61,-115,99,44,38,-28,44,108,-123,101,0,1,-57,90,-90,55,-59,32,97,-107,101,60,31,113,67,-9,-107,-127,104,-49,66,-15,109,-113,-10,7,-118,23,81,-128,-3,-9,75,-123,-6,-12,108,-1,0,58,-9,45,38,-15,47,-12,-53,123,-108,-23,34,3,-113,74,-16,123,-3,94,63,19,120,106,-51,-40,-30,-14,-43,-4,-71,51,-35,74,-13,-4,-77,94,-93,-16,-57,82,123,-33,12,71,4,-51,-70,72,0,92,-6,-116,86,112,118,118,42,75,-35,-71,-39,-47,69,21,-87,-111,71,81,-44,33,-46,-43,39,-99,113,19,-72,71,-109,-5,-103,56,4,-5,100,-45,117,109,42,13,102,-60,-37,-54,126,83,-48,-118,-101,81,-80,-121,81,-79,-106,-50,113,-104,-27,24,35,56,-49,57,-2,-107,-62,-55,-29,39,-16,110,-89,119,-90,106,106,-9,54,-79,29,-15,58,-100,-56,-120,-59,112,57,-22,6,-29,-7,80,-46,107,80,78,-52,-19,-12,-69,73,44,-20,99,-76,-109,105,88,84,34,-111,-36,10,-72,84,17,-126,50,43,55,71,-15,14,-105,-81,-37,-7,-6,101,-20,83,-116,100,-88,63,50,-3,87,-88,-83,58,22,-120,14,83,89,-16,94,-97,-88,-119,85,-30,-62,-53,-49,29,-101,-42,-68,-125,89,-16,117,-34,-97,-88,53,-123,-52,103,115,28,67,54,56,-109,-65,95,95,-25,-7,-41,-47,4,41,-62,-98,-3,43,63,85,-46,108,-11,91,86,-74,-67,-117,124,103,-8,-121,5,72,-25,57,-19,80,-31,-40,-75,46,-25,-50,49,-57,44,18,27,27,-28,43,50,-97,-35,-74,121,92,31,-44,31,122,-110,-22,-38,-38,-23,-43,36,81,11,74,-40,98,-65,116,55,102,7,-45,-41,-16,-81,86,-43,124,19,108,-16,-7,58,-109,121,-15,-97,-11,119,-128,109,117,-12,-36,71,127,122,-29,117,111,4,-22,-6,60,70,101,-125,-5,74,-60,28,-105,81,-5,-60,30,-32,117,-21,-100,-118,-49,91,-107,115,-125,95,-76,104,-9,-50,-114,-68,-81,-54,-21,-39,-123,122,-17,-62,109,85,38,50,-64,56,-35,-56,-63,-29,25,-50,63,12,-102,-13,93,70,-47,-82,81,110,-29,-108,77,10,-82,-34,79,-50,-125,-48,-9,-92,-16,-34,-79,117,-31,-83,90,43,-76,103,48,110,27,-16,120,34,-82,-9,-41,-88,45,52,62,-94,-94,-87,105,58,-115,-66,-85,-90,-61,121,109,34,-55,28,-118,8,42,115,87,107,67,32,-81,31,-8,-55,97,-115,78,-42,-19,87,34,104,89,31,31,-20,-14,63,-103,-81,96,-82,99,-58,-34,27,-1,0,-124,-121,75,88,-111,-10,-56,-110,6,95,67,-63,28,-2,4,-45,66,123,30,21,-31,-83,63,-60,18,-34,73,117,-31,-12,-97,-19,54,-104,37,-95,-19,-100,-16,123,30,-99,59,-41,-89,120,63,-30,78,-85,123,122,-70,78,-69,-89,-86,92,-113,-105,-52,80,80,-109,-18,-66,-65,74,-97,-31,22,-100,-42,112,107,77,34,-128,-26,-23,99,32,118,-38,63,-6,-11,-35,93,105,54,23,-18,-110,92,91,70,-14,70,114,-110,109,-61,47,-48,-48,-63,92,108,-62,-30,119,-118,88,-114,-48,-89,59,125,106,-22,29,-56,9,20,70,-118,-120,20,115,-113,90,117,74,67,35,120,-63,66,-69,3,41,-22,-90,-88,-75,-110,-62,91,-55,-5,-121,-17,68,-36,-113,-62,-76,-87,10,-85,-116,28,26,26,-72,30,123,-30,63,3,105,-70,-86,125,-90,40,-66,-55,112,6,60,-56,-57,13,-11,21,-25,-105,-2,27,-71,-48,-18,-106,45,70,37,107,119,32,9,58,-95,31,92,113,-2,121,-81,123,-110,-55,89,72,95,-69,-23,89,-73,22,81,75,19,-37,-35,68,30,46,-63,-105,53,14,38,-79,-111,-25,58,71,-10,-97,-124,21,111,116,-93,61,-18,-105,33,-52,-42,-72,-36,-47,-6,-108,-57,4,123,87,-88,-24,-38,-43,-106,-75,96,-105,86,119,9,50,48,-2,19,-56,62,-121,-48,-42,36,30,31,77,53,-116,-70,75,42,-60,-36,-104,24,-4,-65,-121,-89,-14,-84,13,75,71,-69,-79,-44,91,85,-48,37,22,-105,-89,-103,-83,-97,-3,92,-33,81,-3,69,9,-75,-72,52,-103,-1,-39};

int count = sizeof(s);

//for(pData = pBuffer, i = 0; i < count; ++i)
//{
// *pData++ = s[i]; 0xFF; //R
// *pData++ = s[i+1];//0×0; //G
// *pData++ = s[i+2];//0×0; //B
//}

provider = CGDataProviderCreateWithData(NULL, s, count, NULL);

return CGImageCreate(320,480,
bitsPerComponent,
bitsPerPixel,
bytesPerRow,
colorSpaceRef,
bmpInof,
provider,
NULL,
NO,
renderingIntent);
}

#import “ImageBlob.h”

@implementation ImageBlob

+ (int) addBlob : (id) data {

const char * sql = “insert into ImageBlob (image) values(?) “;

NSString *path = [[NSBundle mainBundle] pathForResource:@”login” ofType:@”png”];

NSData *signatureImage = [[NSData alloc] initWithContentsOfFile:path];

//if(data==nil) return 0;

//signatureImage = (NSData *)data;

sqlite3_stmt *insert_statement = nil;

@try{

if(sqlite3_prepare_v2([DBHandle database:kDbname], sql, -1, &insert_statement, NULL)!=SQLITE_ERROR){

sqlite3_bind_blob(insert_statement,1, [signatureImage bytes], [signatureImage length], NULL);

if (sqlite3_step(insert_statement) == SQLITE_ERROR){

DLog(@”Error: ImageBlob failed to insert NewsItem into the database with message.”);

}

if(sqlite3_finalize(insert_statement) != SQLITE_OK){

DLog(@”add ImageBlob:Failed to finalize data statement, normally error handling here.”);
}

}
else
{
DLog(@”Error: ImageBlob failed to sqlite3_prepare_v2 insert Category into the database with message.”);
return DB_ERR;
}
}
@catch (NSException *e) {

DLog(@”ImageBlob add An exception occurred: %@ \n”, [e reason]);

return DB_ERR;
}

DLog(@”ImageBlob ok “);

return DB_OK;

}

+(NSData *) getBlob {

const char * sql;

sql = “SELECT * FROM ImageBlob ORDER BY BID DESC” ;

sqlite3_stmt *statement = nil;

@try{

if (sqlite3_prepare_v2([DBHandle database:kDbname] , sql, -1, &statement, NULL) != SQLITE_OK){
DLog(@”getBlob:Error, failed to prepare statement, normally handleerror here.\n”);
}
while (sqlite3_step(statement) == SQLITE_ROW) {

NSData * data = [[NSData alloc] initWithBytes:sqlite3_column_blob(statement, 1)
length: sqlite3_column_bytes(statement, 1)];

DLog(@”getBlob =%@ \n “,[data description]);

return data;

}
if(sqlite3_finalize(statement) != SQLITE_OK){

DLog(@”getBlob:Failed to finalize data statement, normally error handling here.”);
}

} @catch (NSException *e) {

DLog(@”getBlob:An exception occurred: %@”, [e reason]);

return nil;
}
DLog(@”getBlob end\n “);

return nil;

}

@end



发表评论

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

CAPTCHA image