This file contains 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.UIKit; | |
using MonoTouch.SceneKit; | |
using MonoTouch.Foundation; | |
namespace HelloSceneKit | |
{ | |
public class HelloSceneKitController : UIViewController | |
{ | |
SCNView sceneView; |
This file contains 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 qrCode = new CIQRCodeGenerator { | |
Message = NSData.FromString (someText), | |
CorrectionLevel = "Q" | |
}.OutputImage; | |
UIGraphics.BeginImageContext (new SizeF (qrCode.Extent.Width * 8, qrCode.Extent.Height * 8)); | |
var cgCtx = UIGraphics.GetCurrentContext (); | |
var ciCtx = CIContext.FromOptions (null); | |
cgCtx.InterpolationQuality = CGInterpolationQuality.None; | |
cgCtx.DrawImage (cgCtx.GetClipBoundingBox (), ciCtx.CreateCGImage (qrCode, qrCode.Extent)); |
This file contains 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
NSError error = null; | |
var htmlString = new NSAttributedString (NSUrl.FromFilename ( | |
"Test.html"), | |
new NSAttributedStringDocumentAttributes{ DocumentType = NSDocumentType.HTML }, | |
ref error); | |
textView.AttributedText = htmlString; |
This file contains 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
NSError err; | |
ab = ABAddressBook.Create (out err); | |
if (err == null) { | |
ab.RequestAccess ((allowed, err1) => { | |
if (allowed) { | |
var people = ab.GetPeople (); | |
foreach (ABPerson person in people) { |
This file contains 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
//does the actual coloring | |
void DrawPoints (CGContext dctx) | |
{ | |
dctx.BeginPath (); | |
dctx.MoveTo (Points.First().X, Points.First().Y); | |
dctx.SetLineWidth(swatchSlider.Value); | |
dctx.SetBlendMode (CGBlendMode.Normal); | |
foreach (var crayon in Crayons) { |
This file contains 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 NSArray ToNSArray (int[] array) | |
{ | |
NSArray nsArray = null; | |
var objects = Array.ConvertAll (array, i => (object)i); | |
if (objects != null) { | |
nsArray = NSArray.FromObjects (objects); | |
} | |
return nsArray; |
This file contains 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
NetDelegate _netDel; | |
NSNetService _ns; | |
void InitNetService () | |
{ | |
_ns = new NSNetService ("", "_testservice._tcp", UIDevice.CurrentDevice.Name, 9999); | |
_netDel = new NetDelegate (); | |
_ns.Delegate = _netDel; | |
// add TXTRecordData |
NewerOlder