This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using MonoTouch.Dialog; | |
| using MonoTouch.UIKit; | |
| using System.Drawing; | |
| using MonoTouch.Foundation; | |
| using MonoTouch.CoreAnimation; | |
| public class ButtonElement : Element | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using FarseerPhysics.Dynamics; | |
| using FarseerPhysics.Factories; | |
| using Microsoft.Xna.Framework; | |
| using Microsoft.Xna.Framework.Graphics; | |
| using Microsoft.Xna.Framework.Input; | |
| using System; | |
| namespace FarseerPhysics.HelloWorld | |
| { | |
| /// <summary> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //After build | |
| Command : cp -r ${ProjectDir}/bin/iPhone/Release/MyAppName.app toZip/Payload | |
| Working Directory: ${SolutionDir} | |
| //AfterBuild | |
| Command : zip -r ../MyApp.ipa * | |
| WorkingDirectory: ${SolutionDir}/toZip |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var recognizerLeft = new UISwipeGestureRecognizer (this, new Selector ("swipeLeft")); | |
| recognizerLeft.Direction = UISwipeGestureRecognizerDirection.Left; | |
| AddGestureRecognizer (recognizerLeft); | |
| [Export("swipeLeft")] | |
| public void swipeLeft (UISwipeGestureRecognizer sender) | |
| { | |
| ... | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static NSSTring ToNSString(this string str) | |
| { | |
| return new NSString(str); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public void Begin(SpriteSortMode sortMode, BlendState blendState, SamplerState samplerState, DepthStencilState depthStencilState, RasterizerState rasterizerState, Effect effect, Matrix transformMatrix) | |
| { | |
| _sortMode = sortMode; | |
| _blendState = blendState ?? BlendState.AlphaBlend; | |
| _depthStencilState = depthStencilState ?? DepthStencilState.None; | |
| _samplerState = samplerState ?? SamplerState.LinearClamp; | |
| _rasterizerState = rasterizerState ?? RasterizerState.CullCounterClockwise; | |
| if(effect != null) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* ios version | |
| NSDictionary *contextDict = [NSDictionary dictionaryWithObject:[NSNumber numberWithBool:NO] forKey:@"kCIContextUseSoftwareRenderer"]; | |
| CIContext *ciContext = [CIContext contextWithOptions:contextDict]; | |
| NSDictionary *detectorDict = [NSDictionary dictionaryWithObject:@"CIDetectorAccuracyHigh" forKey:@"CIDetectorAccuracy"]; | |
| CIDetector *detector = [CIDetector detectorOfType:@"CIDetectorTypeFace" context:ciContext options:detectorDict]; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Works | |
| NSURL *urlToFile = [NSURL fileURLWithPath:@"/Users/Clancey/Downloads/IMG_0540.jpg"]; | |
| CIImage *ciImage = [CIImage imageWithContentsOfURL:urlToFile]; | |
| CIDetector *ciDetector = [CIDetector detectorOfType:CIDetectorTypeFace | |
| context:nil | |
| options:nil]; | |
| NSArray *features = [ciDetector featuresInImage:ciImage]; | |
| //Fails | |
| string imageFile = "/Users/Clancey/Downloads/IMG_0540.jpg"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| static IntPtr CoreImage_libraryHandle = Dlfcn.dlopen ("/System/Library/Frameworks/CoreImage.framework/CoreImage", 0); | |
| static NSString _TypeFace; | |
| public static NSString TypeFace { | |
| get { | |
| if (_TypeFace == null) | |
| _TypeFace = Dlfcn.GetStringConstant (CoreImage_libraryHandle, "CIDetectorTypeFace"); | |
| return _TypeFace; | |
| } | |
| } |