Skip to content

Instantly share code, notes, and snippets.

@mikebluestein
mikebluestein / gist:8532580
Created January 21, 2014 01:15
Display a QR Code in Xamarin.iOS using Core Image
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));
@mikebluestein
mikebluestein / gist:e34ef9237619c09bcb7a
Created July 27, 2014 17:30
Core Image Detectors
using System;
using MonoTouch.CoreImage;
using MonoTouch.UIKit;
namespace CIDetectorsDemo
{
public class DetectorController : UIViewController
{
UIImageView imageView;
@mikebluestein
mikebluestein / main.dart
Created June 5, 2018 12:16
Flutter article source
import 'package:flutter/material.dart';
void main() {
runApp(
Container(
color: Colors.lightBlue,
child: Padding(
padding: const EdgeInsets.fromLTRB(0.0, 50.0, 0.0, 0.0),
child: Directionality(
@mikebluestein
mikebluestein / gist:47ba7b7ca4ce65f36b41
Created July 28, 2014 20:49
UICollectionView using a UIViewController
using System;
using System.Drawing;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
namespace CollectionViewWithControllerDemo
{
public class Controller : UIViewController
{
CVSource source;
@mikebluestein
mikebluestein / EffectsController.cs
Created July 8, 2014 22:19
iOS 8 Visual Effects using Xamarin
using System;
using System.Drawing;
using MonoTouch.UIKit;
namespace ViewEffectsDemo
{
public class EffectsController : UIViewController
{
UIImageView imageView;
UIScrollView scrollView;
@mikebluestein
mikebluestein / HelloSceneKitController.cs
Last active November 18, 2022 20:57
A simple iOS 8 Scene Kit example using C# and Xamarin
using System;
using MonoTouch.UIKit;
using MonoTouch.SceneKit;
using MonoTouch.Foundation;
namespace HelloSceneKit
{
public class HelloSceneKitController : UIViewController
{
SCNView sceneView;
var imageView = new UIImageView ();
imageView.Frame = UIScreen.MainScreen.Bounds;
imageView.ContentMode = UIViewContentMode.ScaleAspectFit;
var qrCode = new CIQRCodeGenerator {
Message = NSData.FromString ("test"),
CorrectionLevel = "Q"
}.OutputImage;
UIGraphics.BeginImageContext (new SizeF (qrCode.Extent.Width * 8, qrCode.Extent.Height * 8));