Skip to content

Instantly share code, notes, and snippets.

Avatar

Arthur ArthurHub

View GitHub Profile
@ArthurHub
ArthurHub / AndroidManifest.xml
Last active Jul 17, 2017
Asynchronous Android Crop Camera Image with Custom Progress UI
View AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.example.arthu.testandroidcropper"
xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
@ArthurHub
ArthurHub / AndroidManifest.xml
Last active Jun 11, 2020
Android Crop Camera Image
View AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.example.arthu.testandroidcropper"
xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
View HtmlSyntaxHighlighter.cs
/// <summary>
/// HTML syntax highlighting using Rich-Text formatting.<br/>
/// - Handle plain input or already in RTF format.<br/>
/// - Handle if input already contains RTF color table.<br/>
/// - Rich coloring adjusted to Visual Studio HTML coloring.<br/>
/// - Support to provide custom colors.<br/>
/// - High performance (as much as RTF format allows).<br/>
/// </summary>
/// <remarks>
/// The MIT License (MIT) Copyright (c) 2014 Arthur Teplitzki.<br/>
View RenderingMethods.cs
public class Test
{
private const int BaseIterations = 3;
private const int RenderIterations = 10000;
private const string TestString = "Test-s.tri,ng m(g=j{}3)";
private static readonly Font _font1 = new Font("Arial", 11);
// private static readonly Font _font1 = new Font("Segoe UI", 9);
// private static readonly Font _font1 = new Font("Tahoma", 10);
// private static readonly Font _font1 = new Font("Microsoft Sans Serif", 9);
@ArthurHub
ArthurHub / ClipboardHelper.cs
Last active May 23, 2019
Helper class for setting HTML and plain text formatting to clipboard (http://theartofdev.com/2014/06/12/setting-htmltext-to-clipboard-revisited/)
View ClipboardHelper.cs
/// <summary>
/// Helper to encode and set HTML fragment to clipboard.<br/>
/// See http://theartofdev.com/2014/06/12/setting-htmltext-to-clipboard-revisited/.<br/>
/// <seealso cref="CreateDataObject"/>.
/// </summary>
/// <remarks>
/// The MIT License (MIT) Copyright (c) 2014 Arthur Teplitzki.
/// </remarks>
public static class ClipboardHelper
{
View Resources.tt
<#@ template debug="false" hostspecific="true" language="C#" #>
<#@ output extension=".cs" encoding="UTF8" #>
<#@ assembly name="System.Core" #>
<#@ assembly name="System.Xml" #>
<#@ assembly name="System.Xml.Linq" #>
<#@ import namespace="System.IO" #>
<#@ import namespace="System.Xml" #>
<#@ import namespace="System.Xml.Linq" #>
<#
//
View NativeTextRenderer.cs
/// <summary>
/// Wrapper for GDI text rendering functions<br/>
/// This class is not thread-safe as GDI function should be called from the UI thread.
/// </summary>
/// <remarks>
/// http://theartofdev.com/2013/08/12/using-native-gdi-for-text-rendering-in-c/<br/>
/// The MIT License (MIT) Copyright (c) 2014 Arthur Teplitzki.
/// </remarks>
public sealed class NativeTextRenderer : IDisposable
{
You can’t perform that action at this time.