Skip to content

Instantly share code, notes, and snippets.

@Zolomon
Created May 11, 2017 15:04
Show Gist options
  • Select an option

  • Save Zolomon/29a68a4c49d800bb5d48b5e524aaca3b to your computer and use it in GitHub Desktop.

Select an option

Save Zolomon/29a68a4c49d800bb5d48b5e524aaca3b to your computer and use it in GitHub Desktop.
Draw shenanigans to the screen!
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace Picasso
{
class Program
{
[DllImport("user32.dll")]
static extern IntPtr GetDC(IntPtr hWnd);
[DllImport("gdi32.dll", ExactSpelling = true, PreserveSig = true, SetLastError = true)]
static extern bool Ellipse(IntPtr hdc, int nLeftRect, int nTopRect,
int nRightRect, int nBottomRect);
static void Main(string[] args)
{
var dc = GetDC((IntPtr)0);
while (true)
{
Ellipse(dc, 10, 10, 200, 200);
}
// Cheers, zol :D
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment