diff options
| author | Michael <[email protected]> | 2017-05-18 18:34:22 -0400 |
|---|---|---|
| committer | Michael <[email protected]> | 2017-05-18 18:57:04 -0400 |
| commit | 18ceccb1218f167d6bb836762f7aeea6e8b9d892 (patch) | |
| tree | 529c74a68697d3057c7c58a0dbc9f65b2d39fca3 /ShiftOS.WinForms | |
| parent | a872d21355660a7538db3115bf30c0bf5a4b4f33 (diff) | |
| download | shiftos_thereturn-18ceccb1218f167d6bb836762f7aeea6e8b9d892.tar.gz shiftos_thereturn-18ceccb1218f167d6bb836762f7aeea6e8b9d892.tar.bz2 shiftos_thereturn-18ceccb1218f167d6bb836762f7aeea6e8b9d892.zip | |
Revert "i <3 rylan wait wrong textbox whatever"
This reverts commit 20d44ba1334b5af65605de27a01e8dcb40fa2081.
Diffstat (limited to 'ShiftOS.WinForms')
| -rw-r--r-- | ShiftOS.WinForms/Controls/ShiftedProgressBar.cs | 37 |
1 files changed, 4 insertions, 33 deletions
diff --git a/ShiftOS.WinForms/Controls/ShiftedProgressBar.cs b/ShiftOS.WinForms/Controls/ShiftedProgressBar.cs index 3c8550c..ceaff02 100644 --- a/ShiftOS.WinForms/Controls/ShiftedProgressBar.cs +++ b/ShiftOS.WinForms/Controls/ShiftedProgressBar.cs @@ -27,7 +27,6 @@ using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; -using System.Drawing.Drawing2D; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -139,40 +138,12 @@ namespace ShiftOS.WinForms.Controls } } - public TextureBrush CreateBG() - { - var tex = new TextureBrush(RealBackgroundImage); - var mt = new Matrix(new Rectangle(0, 0, this.Width, this.Height), new[] - { - new Point(0,0), - new Point(this.Width,0), - new Point(this.Width, this.Height) - }); - tex.Transform = mt; - tex.WrapMode = WrapMode.Clamp; - return tex; - } - - public TextureBrush CreateTexture() - { - var tex = new TextureBrush(ProgressImage); - var mt = new Matrix(new Rectangle(0, 0, this.Width, this.Height), new[] - { - new Point(0,0), - new Point(this.Width,0), - new Point(this.Width, this.Height) - }); - tex.Transform = mt; - tex.WrapMode = WrapMode.Clamp; - return tex; - } - protected override void OnPaint(PaintEventArgs pe) { pe.Graphics.Clear(this.RealBackColor); if(RealBackgroundImage != null) { - pe.Graphics.FillRectangle(CreateBG(), new Rectangle(0, 0, this.Width, this.Height)); + pe.Graphics.FillRectangle(new TextureBrush(RealBackgroundImage), new Rectangle(0, 0, this.Width, this.Height)); } switch (Style) { @@ -180,7 +151,7 @@ namespace ShiftOS.WinForms.Controls double width = linear(this.Value, 0, this.Maximum, 0, this.Width); if (ProgressImage != null) { - pe.Graphics.FillRectangle(CreateTexture(), new RectangleF(0, 0, (float)width, this.Height)); + pe.Graphics.FillRectangle(new TextureBrush(ProgressImage), new RectangleF(0, 0, (float)width, this.Height)); } else { @@ -195,7 +166,7 @@ namespace ShiftOS.WinForms.Controls int position = i * (BlockSize + 2); if (ProgressImage != null) { - pe.Graphics.FillRectangle(CreateTexture(), new Rectangle(position, 0, BlockSize, this.Height)); + pe.Graphics.FillRectangle(new TextureBrush(ProgressImage), new Rectangle(position, 0, BlockSize, this.Height)); } else @@ -207,7 +178,7 @@ namespace ShiftOS.WinForms.Controls case ProgressBarStyle.Marquee: if (ProgressImage != null) { - pe.Graphics.FillRectangle(CreateTexture(), new Rectangle(_marqueePos, 0, this.Width / 4, this.Height)); + pe.Graphics.FillRectangle(new TextureBrush(ProgressImage), new Rectangle(_marqueePos, 0, this.Width / 4, this.Height)); } else { |
