Fork me on GitHub

2012年5月7日

摘要: Converting from UIImage/CGImage to Leptonica Pix structureUIImage *image = [UIImage imageNamed:@"test.png"];...CFDataRef imageData = CGDataProviderCopyData(CGImageGetDataProvider([image CGImage]));const UInt8 *rasterData = CFDataGetBytePtr(data); /*----------------------------------------- 阅读全文
posted @ 2012-05-07 19:38 pengyingh 阅读(357) 评论(0) 推荐(0)
摘要: FileStream MyFileStream; long FileSize; MyFileStream = new FileStream=("c:\\a.doc",FileMode.Open); FileSize = MyFileStream.Length; byte[] Buffer = new byte[(int)FileSize]; MyFileStream.Read(Buffer, 0, (int)FileSize); MyFileStream.Close(); Response.AddHeader("Content-Disposition", 阅读全文
posted @ 2012-05-07 19:02 pengyingh 阅读(199) 评论(0) 推荐(0)
摘要: //// network.h// AUOiWay_Mobile//// Created by Mahmood1 on 2/21/12.// Copyright (c) 2012 __MyCompanyName__. All rights reserved.//#import<UIKit/UIKit.h>#define SUPPORTS_IOKIT_EXTENSIONS 1/** To use, you must add the (semi)public IOKit framework before compiling*/#if SUPPORTS_IOKIT_EXTENSIONS@i 阅读全文
posted @ 2012-05-07 18:54 pengyingh 阅读(10779) 评论(1) 推荐(0)
摘要: /* * The MIT License * * Copyright (c) 2011 Paul Solt, PaulSolt@gmail.com * * https://github.com/PaulSolt/UIImage-Conversion/blob/master/MITLicense.txt * */#import <Foundation/Foundation.h>@interface ImageHelper : NSObject { }/** Converts a UIImage to RGBA8 bitmap. @param image - a UIImage to 阅读全文
posted @ 2012-05-07 17:04 pengyingh 阅读(1315) 评论(0) 推荐(0)
摘要: My Postcards app has a design screen where you can change colors of things, so I needed a color picker. A very easy way to make a color picker on just about any platform is to make some kind of color pallet image file, display it for the user to click on, and do a call like: getPixelColorAtScreenLoc 阅读全文
posted @ 2012-05-07 16:24 pengyingh 阅读(524) 评论(0) 推荐(0)
摘要: http://stackoverflow.com/questions/144250/how-to-get-the-rgb-values-for-a-pixel-on-an-image-on-the-iphoneMethod 1: Writable Pixel InformationI defined constants#define RGBA 4#define RGBA_8_BIT 8In my UIImage subclass I declared instance variables:size_t bytesPerRow;size_t byteCount;size_t pi... 阅读全文
posted @ 2012-05-07 16:22 pengyingh 阅读(2331) 评论(0) 推荐(0)
摘要: /**检查某点是否包含在多边形的范围内(只用与判断在多边形内部,不包含点在多边形边上的情况)~*/- (BOOL) checkPointWithinPolygon:(PolyVerticesWrapper*)pvw point:(b2Vec2)point { intverticesCount = [pvwverticesCount]; b2Vec2*ptPolygon = [pvwvertices]; intnCross =0; for(inti = 0; i < verticesCount; ++ i) { floatj = ptPolygon[i].x; floatk... 阅读全文
posted @ 2012-05-07 09:07 pengyingh 阅读(4140) 评论(0) 推荐(0)

导航