All pastes #27621 Raw Edit

Untitled

public text v1 · immutable
#27621 ·published 2005-11-04 18:10 UTC
rendered paste body
using System;
using System.Drawing.Imaging;
using System.Drawing;
using System.Drawing.Drawing2D;

//
public class graphicsUI {	
	static void DrawCross (Graphics dc, int x, int middle) {
		dc.DrawLine (new Pen (Color.Red), (float)(x + 2)+1f, (float)(middle)+.5f, (float)(x + 6)+1f, (float)(middle)+.5f);
		dc.DrawLine (new Pen (Color.Red), (float)(x + 4)+1f, (float)(middle - 2)+.5f, (float)(x + 4)+1f, (float)(middle + 2)+.5f);
	}
	
	public static void Main () {

		Bitmap bmp = new Bitmap (100, 100);
		Graphics dc = Graphics.FromImage (bmp);
		
		Pen bluePen = new Pen (Color.Blue);
		dc.DrawLine (bluePen, 6f,5.5f, 11f,10.5f);
		dc.DrawLine (bluePen, 3f, 2.5f, 6f, 2.5f);

		Pen yellowPen = new Pen (Color.Yellow);
		dc.DrawLine (yellowPen, 21f, 5.5f, 21f, 10.5f);
		dc.DrawLine (yellowPen, 31f, 30.5f, 31f, 30.5f);
		dc.DrawLine (yellowPen, 31f, 45.5f, 31f, 40.5f);

		DrawCross (dc, 5, 15);
		DrawCross (dc, 14, 26);

		dc.DrawLine(yellowPen, 1.5f, 0.0f, 1.5f, 10.0f);
		
		bmp.Save("bug.png", ImageFormat.Png);
	}

}