diff options
| author | Michael <[email protected]> | 2017-07-05 13:15:00 -0400 |
|---|---|---|
| committer | Michael <[email protected]> | 2017-07-05 13:15:00 -0400 |
| commit | de9bc8567b268e9659d174f65ce7dc23dff6fafe (patch) | |
| tree | b311f063400314c1ef7a348524935ff381d8253e /ShiftOS.Frontend/GUI/PictureBox.cs | |
| parent | e7b288968b8923eb5a7b9c358de75e521f1d8bde (diff) | |
| download | shiftos_thereturn-de9bc8567b268e9659d174f65ce7dc23dff6fafe.tar.gz shiftos_thereturn-de9bc8567b268e9659d174f65ce7dc23dff6fafe.tar.bz2 shiftos_thereturn-de9bc8567b268e9659d174f65ce7dc23dff6fafe.zip | |
experimental stuff
Diffstat (limited to 'ShiftOS.Frontend/GUI/PictureBox.cs')
| -rw-r--r-- | ShiftOS.Frontend/GUI/PictureBox.cs | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/ShiftOS.Frontend/GUI/PictureBox.cs b/ShiftOS.Frontend/GUI/PictureBox.cs index 91735aa..6f60b29 100644 --- a/ShiftOS.Frontend/GUI/PictureBox.cs +++ b/ShiftOS.Frontend/GUI/PictureBox.cs @@ -8,12 +8,13 @@ using System.Threading.Tasks; using ShiftOS.Engine; using System.Drawing.Imaging; using ShiftOS.Frontend.GraphicsSubsystem; +using Microsoft.Xna.Framework.Graphics; namespace ShiftOS.Frontend.GUI { public class PictureBox : Control { - private System.Drawing.Image img = null; + private Texture2D img = null; private ImageLayout _layout = ImageLayout.Fit; public ImageLayout ImageLayout @@ -28,7 +29,7 @@ namespace ShiftOS.Frontend.GUI } } - public System.Drawing.Image Image + public Texture2D Image { get { @@ -53,6 +54,16 @@ namespace ShiftOS.Frontend.GUI protected override void OnPaint(GraphicsContext gfx) { + switch (_layout) + { + case ImageLayout.Stretch: + gfx.DrawRectangle(0, 0, Width, Height, Image); + break; + case ImageLayout.None: + gfx.DrawRectangle(0, 0, Image.Width, Image.Height, Image); + break; + } + } //Again, thanks StackOverflow |
