示例#1
0
		public FormButtonHitter(Root root)
		{
			Root = root;
			FC = Root.FormCollection;
			InitializeComponent();

			this.Left = FC.gpButtons.Left;
			this.Top = FC.gpButtons.Top;
			this.Width = FC.gpButtons.Width;
			this.Height = FC.gpButtons.Height;
		}
示例#2
0
		public FormDisplay(Root root)
		{
			Root = root;
			InitializeComponent();

			this.Left = SystemInformation.VirtualScreen.Left;
			this.Top = SystemInformation.VirtualScreen.Top;
			int targetbottom = 0;
			foreach (Screen screen in Screen.AllScreens)
			{
				if (screen.WorkingArea.Bottom > targetbottom)
					targetbottom = screen.WorkingArea.Bottom;
			}
			int virwidth = SystemInformation.VirtualScreen.Width;
			this.Width = virwidth;
			this.Height = targetbottom - this.Top;

			Bitmap InitCanvus = new Bitmap(this.Width, this.Height);
			Canvus = InitCanvus.GetHbitmap(Color.FromArgb(0));
			OneStrokeCanvus = InitCanvus.GetHbitmap(Color.FromArgb(0));
			//BlankCanvus = InitCanvus.GetHbitmap(Color.FromArgb(0));

			IntPtr screenDc = GetDC(IntPtr.Zero);
			canvusDc = CreateCompatibleDC(screenDc);
			SelectObject(canvusDc, Canvus);
			onestrokeDc = CreateCompatibleDC(screenDc);
			SelectObject(onestrokeDc, OneStrokeCanvus);
			//blankcanvusDc = CreateCompatibleDC(screenDc);
			//SelectObject(blankcanvusDc, BlankCanvus);
			gCanvus = Graphics.FromHdc(canvusDc);
			gCanvus.CompositingMode = System.Drawing.Drawing2D.CompositingMode.SourceCopy;
			gOneStrokeCanvus = Graphics.FromHdc(onestrokeDc);
			gOneStrokeCanvus.CompositingMode = System.Drawing.Drawing2D.CompositingMode.SourceCopy;
			if (Root.AutoScroll)
			{
				hScreenBitmap = InitCanvus.GetHbitmap(Color.FromArgb(0));
				memscreenDc = CreateCompatibleDC(screenDc);
				SelectObject(memscreenDc, hScreenBitmap);
				screenbits = new byte[50000000];
				lastscreenbits = new byte[50000000];
			}
			ReleaseDC(IntPtr.Zero, screenDc);
			InitCanvus.Dispose();

			//this.DoubleBuffered = true;

			gpButtonsImage = new Bitmap(2400, 100);
			TransparentBrush = new SolidBrush(Color.Transparent);
			SemiTransparentBrush = new SolidBrush(Color.FromArgb(120, 255, 255, 255));


			ToTopMostThrough();
		}
示例#3
0
文件: Root.cs 项目: geovens/gInk
		public TestMessageFilter(Root root)
		{
			Root = root;
		}
示例#4
0
		public FormCollection(Root root)
		{
			Root = root;
			InitializeComponent();

			this.Left = SystemInformation.VirtualScreen.Left;
			this.Top = SystemInformation.VirtualScreen.Top;
			int targetbottom = 0;
			foreach (Screen screen in Screen.AllScreens)
			{
				if (screen.WorkingArea.Bottom > targetbottom)
					targetbottom = screen.WorkingArea.Bottom;
			}
			int virwidth = SystemInformation.VirtualScreen.Width;
			this.Width = virwidth;
			this.Height = targetbottom - this.Top;
			this.DoubleBuffered = true;

			gpButtonsLeft = Screen.PrimaryScreen.WorkingArea.Right - gpButtons.Width + (Screen.PrimaryScreen.WorkingArea.Left - SystemInformation.VirtualScreen.Left);
			gpButtonsTop = Screen.PrimaryScreen.WorkingArea.Bottom - gpButtons.Height - 10 + (Screen.PrimaryScreen.WorkingArea.Top - SystemInformation.VirtualScreen.Top);
			gpButtons.Left = gpButtonsLeft + gpButtons.Width;
			gpButtons.Top = gpButtonsTop;

			IC = new InkOverlay(this.Handle);
			IC.CollectionMode = CollectionMode.InkOnly;
			IC.AutoRedraw = false;
			IC.DynamicRendering = false;
			IC.EraserMode = InkOverlayEraserMode.StrokeErase;
			IC.CursorInRange += IC_CursorInRange;
			IC.MouseDown += IC_MouseDown;
			IC.MouseMove += IC_MouseMove;
			IC.MouseUp += IC_MouseUp;
			IC.CursorDown += IC_CursorDown;
			IC.Stroke += IC_Stroke;
			IC.DefaultDrawingAttributes.Width = 80;
			IC.DefaultDrawingAttributes.Transparency = 30;
			IC.DefaultDrawingAttributes.AntiAliased = true;

			cursorred = new System.Windows.Forms.Cursor(gInk.Properties.Resources.cursorred.Handle);
			//cursoryellow = new System.Windows.Forms.Cursor(gInk.Properties.Resources.cursoryellow.Handle);
			//cursorblue = new System.Windows.Forms.Cursor(gInk.Properties.Resources.cursorblue.Handle);
			IC.Cursor = cursorred;
			this.Cursor = cursorred;
			IC.Enabled = true;

			image_exit = new Bitmap(btStop.Width, btStop.Height);
			Graphics g = Graphics.FromImage(image_exit);
			g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
			g.DrawImage(global::gInk.Properties.Resources.exit, 0, 0, btStop.Width, btStop.Height);
			btStop.Image = image_exit;
			image_clear = new Bitmap(btClear.Width, btClear.Height);
			g = Graphics.FromImage(image_clear);
			g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
			g.DrawImage(global::gInk.Properties.Resources.garbage, 0, 0, btClear.Width, btClear.Height);
			btClear.Image = image_clear;
			image_undo = new Bitmap(btUndo.Width, btUndo.Height);
			g = Graphics.FromImage(image_undo);
			g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
			g.DrawImage(global::gInk.Properties.Resources.undo, 0, 0, btUndo.Width, btUndo.Height);
			btUndo.Image = image_undo;
			image_eraser_act = new Bitmap(btEraser.Width, btEraser.Height);
			g = Graphics.FromImage(image_eraser_act);
			g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
			g.DrawImage(global::gInk.Properties.Resources.eraser_act, 0, 0, btEraser.Width, btEraser.Height);
			image_eraser = new Bitmap(btEraser.Width, btEraser.Height);
			g = Graphics.FromImage(image_eraser);
			g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
			g.DrawImage(global::gInk.Properties.Resources.eraser, 0, 0, btEraser.Width, btEraser.Height);
			btEraser.Image = image_eraser;
			image_snap = new Bitmap(btSnap.Width, btSnap.Height);
			g = Graphics.FromImage(image_snap);
			g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
			g.DrawImage(global::gInk.Properties.Resources.snap, 0, 0, btSnap.Width, btSnap.Height);
			btSnap.Image = image_snap;
			image_dock = new Bitmap(btDock.Width, btDock.Height);
			g = Graphics.FromImage(image_dock);
			g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
			g.DrawImage(global::gInk.Properties.Resources.dock, 0, 0, btDock.Width, btDock.Height);
			image_dockback = new Bitmap(btDock.Width, btDock.Height);
			g = Graphics.FromImage(image_dockback);
			g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
			g.DrawImage(global::gInk.Properties.Resources.dockback, 0, 0, btDock.Width, btDock.Height);
			if (Root.Docked)
				btDock.Image = image_dockback;
			else
				btDock.Image = image_dock;

			image_pencil = new Bitmap(btPen3.Width, btPen3.Height);
			g = Graphics.FromImage(image_pencil);
			g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
			g.DrawImage(global::gInk.Properties.Resources.pencil, 0, 0, btPen3.Width, btPen3.Height);
			image_highlighter = new Bitmap(btPen3.Width, btPen3.Height);
			g = Graphics.FromImage(image_highlighter);
			g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
			g.DrawImage(global::gInk.Properties.Resources.highlighter, 0, 0, btPen3.Width, btPen3.Height);
			image_pencil_act = new Bitmap(btPen3.Width, btPen3.Height);
			g = Graphics.FromImage(image_pencil_act);
			g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
			g.DrawImage(global::gInk.Properties.Resources.pencil_act, 0, 0, btPen3.Width, btPen3.Height);
			image_highlighter_act = new Bitmap(btPen3.Width, btPen3.Height);
			g = Graphics.FromImage(image_highlighter_act);
			g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
			g.DrawImage(global::gInk.Properties.Resources.highlighter_act, 0, 0, btPen3.Width, btPen3.Height);

			image_pointer = new Bitmap(btPointer.Width, btPointer.Height);
			g = Graphics.FromImage(image_pointer);
			g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
			g.DrawImage(global::gInk.Properties.Resources.pointer, 0, 0, btPointer.Width, btPointer.Height);
			image_pointer_act = new Bitmap(btPointer.Width, btPointer.Height);
			g = Graphics.FromImage(image_pointer_act);
			g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
			g.DrawImage(global::gInk.Properties.Resources.pointer_act, 0, 0, btPointer.Width, btPointer.Height);

			btPen1.BackColor = Root.Pen1.Color;
			btPen2.BackColor = Root.Pen2.Color;
			btPen3.BackColor = Root.Pen3.Color;
			btPen4.BackColor = Root.Pen4.Color;
			btPen5.BackColor = Root.Pen5.Color;
			btPen1.FlatAppearance.MouseDownBackColor = Root.Pen1.Color;
			btPen2.FlatAppearance.MouseDownBackColor = Root.Pen2.Color;
			btPen3.FlatAppearance.MouseDownBackColor = Root.Pen3.Color;
			btPen4.FlatAppearance.MouseDownBackColor = Root.Pen4.Color;
			btPen5.FlatAppearance.MouseDownBackColor = Root.Pen5.Color;
			btPen1.FlatAppearance.MouseOverBackColor = Root.Pen1.Color;
			btPen2.FlatAppearance.MouseOverBackColor = Root.Pen2.Color;
			btPen3.FlatAppearance.MouseOverBackColor = Root.Pen3.Color;
			btPen4.FlatAppearance.MouseOverBackColor = Root.Pen4.Color;
			btPen5.FlatAppearance.MouseOverBackColor = Root.Pen5.Color;
			if (Root.Pen1.Transparency >= 100)
			{
				image_pen1 = image_highlighter;
				image_pen1_act = image_highlighter_act;
			}
			else
			{
				image_pen1 = image_pencil;
				image_pen1_act = image_pencil_act;
			}
			if (Root.Pen2.Transparency >= 100)
			{
				image_pen2 = image_highlighter;
				image_pen2_act = image_highlighter_act;
			}
			else
			{
				image_pen2 = image_pencil;
				image_pen2_act = image_pencil_act;
			}
			if (Root.Pen3.Transparency >= 100)
			{
				image_pen3 = image_highlighter;
				image_pen3_act = image_highlighter_act;
			}
			else
			{
				image_pen3 = image_pencil;
				image_pen3_act = image_pencil_act;
			}
			if (Root.Pen4.Transparency >= 100)
			{
				image_pen4 = image_highlighter;
				image_pen4_act = image_highlighter_act;
			}
			else
			{
				image_pen4 = image_pencil;
				image_pen4_act = image_pencil_act;
			}
			if (Root.Pen5.Transparency >= 100)
			{
				image_pen5 = image_highlighter;
				image_pen5_act = image_highlighter_act;
			}
			else
			{
				image_pen5 = image_pencil;
				image_pen5_act = image_pencil_act;
			}

			LastTickTime = DateTime.Parse("1987-01-01");
			tiSlide.Enabled = true;

			ToTransparent();
			ToTopMost();
		}