Skip to content

Instantly share code, notes, and snippets.

View dotCoefficient's full-sized avatar

dotCoefficient

View GitHub Profile
using System;
using System.Runtime.InteropServices;
using System.Text.RegularExpressions;
using System.Windows.Forms;
namespace ClipboardRegex
{
static class Program
{
[STAThread]
@dotCoefficient
dotCoefficient / TuneTransparency.cs
Last active December 16, 2016 21:33
Will change the overall transparency of an image.
using System.Drawing;
public static class GraphicHelpers
{
/// <summary>
/// Changes the overall transparency of an image
/// </summary>
/// <param name="originalImage">The input image to be tuned</param>
/// <param name="alpha">the desired alpha value. It is based on the 255 alpha pixels</param>
/// <param name="antialias">To conserve the antialiasing on the image</param>
@dotCoefficient
dotCoefficient / SplitImage.cs
Last active May 22, 2016 16:50
Splits an image into multiple smaller images
using System.Drawing;
using System.Drawing.Imaging;
using System;
using System.Windows.Forms;
public static class SplitImages
{
/// <summary>
/// Splits an image into a section
@dotCoefficient
dotCoefficient / GetEnum.cs
Created May 15, 2016 22:13
Method to safely get enum type & value
using System;
public static class GetEnum
{
public static T? EnumGet<T>(string text) where T : struct
{
if (Enum.IsDefined(typeof(T), text))
return (T)Enum.Parse(typeof(T), text);
return null;
}
}