I hereby claim:
- I am dannycabrera on github.
- I am dannyc (https://keybase.io/dannyc) on keybase.
- I have a public key ASAQdo3ygYwQ9-kyIy9iP8hX1969zoXtQFb4vorZMYtX5go
To claim this, I am signing this object:
| private UIImage GetVideoThumbnail(string path) | |
| { | |
| try { | |
| CMTime actualTime; | |
| NSError outError; | |
| using (var asset = AVAsset.FromUrl (NSUrl.FromFilename (path))) | |
| using (var imageGen = new AVAssetImageGenerator (asset)) | |
| using (var imageRef = imageGen.CopyCGImageAtTime (new CMTime (1, 1), out actualTime, out outError)) { | |
| return UIImage.FromImage (imageRef); | |
| } |
| NSError error = null; | |
| var attributedString = new NSAttributedString (new NSUrl ("...Sample.rtf", false), null, ref error); | |
| var attributedTextHolder = new NSMutableAttributedString (attributedString); | |
| textView.AllowsEditingTextAttributes = true; | |
| textView.AttributedText = attributedTextHolder; |
| NSError error1 = null; | |
| NSError error2 = null; | |
| var atts = new NSAttributedStringDocumentAttributes (); | |
| atts.DocumentType = NSDocumentType.RTF; | |
| using (var wrapper = textView.AttributedText.GetFileWrapperFromRange (new NSRange (0, textView.Text.Length), atts, ref error1)) | |
| { | |
| wrapper.Write (new NSUrl ("...Edited.rtf", false), NSFileWrapperWritingOptions.Atomic, new NSUrl ("...Sample.rtf", false), out error2); | |
| } |
| using Foundation; | |
| using UIKit; | |
| namespace YourApp | |
| { | |
| [Register ("AppDelegate")] | |
| public partial class AppDelegate : UIApplicationDelegate | |
| { | |
| NSObject _screenshotNotification = null; |
| using UIKit; | |
| void AirPrint (CGRect frame, string pdfOrImageToPrint) | |
| { | |
| var printer = UIPrintInteractionController.SharedPrintController; | |
| if (printer == null) { | |
| Console.WriteLine("Unable to print at this time."); | |
| } else { | |
| var printInfo = UIPrintInfo.PrintInfo; |
| using System; | |
| /// <summary> | |
| /// Contains approximate string matching | |
| /// </summary> | |
| static class LevenshteinDistance | |
| { | |
| /// <summary> | |
| /// Compute the distance between two strings. | |
| /// </summary> |
| using System; | |
| using UIKit; | |
| // based on http://blog.functionalfun.net/2008/07/random-pastel-colour-generator.html | |
| public static UIColor RandomColor () | |
| { | |
| Random random = new Random (); | |
| // to create lighter colors: | |
| // take a random integer between 0 & 128 (rather than between 0 and 255) |
| const string FoundationLibrary = "/System/Library/Frameworks/Foundation.framework/Foundation"; | |
| [System.Runtime.InteropServices.DllImport(FoundationLibrary)] | |
| extern static void NSLog(IntPtr format, IntPtr s); | |
| [System.Runtime.InteropServices.DllImport(FoundationLibrary, EntryPoint = "NSLog")] | |
| extern static void NSLog_ARM64(IntPtr format, IntPtr p2, IntPtr p3, IntPtr p4, IntPtr p5, IntPtr p6, IntPtr p7, IntPtr p8, IntPtr s); | |
| static readonly bool Is64Bit = IntPtr.Size == 8; | |
| static readonly bool IsDevice = ObjCRuntime.Runtime.Arch == ObjCRuntime.Arch.DEVICE; |
I hereby claim:
To claim this, I am signing this object:
| Image image = Image.FromFile(@"C:\ArthroscopyImages\1.jpg"); | |
| var userComment = Encoding.UTF8.GetString(image.GetPropertyItem(0x9286).Value); |