- Timestamp:
- 01/12/16 10:42:58 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.BinPacking/PackingPlanVisualizations/2D/PackingPlan2D.cs
r13477 r13497 33 33 namespace PackingPlanVisualizations { 34 34 public partial class PackingPlan2D : UserControl { 35 WindowRenderTarget wndRender = null;36 Factory2D1 factory = new Factory2D1(FactoryType2D1.SingleThreaded);37 SharpDX.DirectWrite.Factory dwFactory = new SharpDX.DirectWrite.Factory(SharpDX.DirectWrite.FactoryType.Shared);38 RenderTargetProperties rndTargProperties = new RenderTargetProperties(new PixelFormat(Format.B8G8R8A8_UNorm, AlphaMode.Premultiplied));39 HwndRenderTargetProperties hwndProperties = new HwndRenderTargetProperties();35 private WindowRenderTarget wndRender; 36 private readonly Factory2D1 factory = new Factory2D1(FactoryType2D1.SingleThreaded); 37 private readonly SharpDX.DirectWrite.Factory dwFactory = new SharpDX.DirectWrite.Factory(SharpDX.DirectWrite.FactoryType.Shared); 38 private readonly RenderTargetProperties rndTargProperties = new RenderTargetProperties(new PixelFormat(Format.B8G8R8A8_UNorm, AlphaMode.Premultiplied)); 39 private HwndRenderTargetProperties hwndProperties; 40 40 41 41 42 #region Packing members BEGIN 43 SolidColorBrush containerBrush; 44 SolidColorBrush containerFillingBrush; 45 SolidColorBrush itemBrush; 46 SolidColorBrush itemFillingBrush; 47 SolidColorBrush labelBrush; 48 TextFormat textFormat; 42 private SolidColorBrush containerBrush; 43 private SolidColorBrush containerFillingBrush; 44 private SolidColorBrush itemBrush; 45 private SolidColorBrush itemFillingBrush; 46 private SolidColorBrush labelBrush; 47 private TextFormat textFormat; 49 48 50 CenteredContainer2D container; 51 #endregion 52 53 //Initialization-Methods 49 private CenteredContainer2D container; 54 50 55 51 public PackingPlan2D() { 56 52 InitializeComponent(); 57 this.SetStyle( 58 ControlStyles.ResizeRedraw, true); 53 this.SetStyle(ControlStyles.ResizeRedraw, true); 59 54 } 60 55 … … 74 69 } 75 70 76 77 78 79 80 //Packing-Methods81 71 public void InitializeContainer(float width, float height) { 82 72 container = new CenteredContainer2D(new Vector2(Math.Max(this.Width - 12, 1), Math.Max(this.Height - 12, 1)), new Vector2(width, height)); … … 86 76 container.AddItem(new Vector2(width, height), new Vector2(x, y), label); 87 77 } 88 89 //Event-Listeners90 78 91 79 private void PackingPlan2D_Load(object sender, EventArgs e) { … … 119 107 wndRender.Resize(new Size2(this.Width, this.Height)); 120 108 } 121 122 109 } 123 110 }
Note: See TracChangeset
for help on using the changeset viewer.