public TestLayer(ScMgr scmgr = null) : base(scmgr) { SizeChanged += ScPanel_SizeChanged; D2DPaint += ScPanel_D2DPaint; MouseMove += TestLayer_MouseMove; }
public App(ScMgr scMgr) { this.scMgr = scMgr; root = scMgr.GetRootLayer(); TestLayer testLayer = new TestLayer(scMgr); testLayer.Name = "layer1"; testLayer.Dock = ScDockStyle.Fill; // testLayer.BackgroundColor = Color.FromArgb(100, 255,0,255); root.Add(testLayer); // testLayer = new TestLayer(scMgr); // testLayer.Name = "layer2"; // testLayer.Location = new PointF(500, 400); // testLayer.Width = 300; // testLayer.Height = 800; // testLayer.BackgroundColor = Color.FromArgb(100, 255, 0, 255); // root.Add(testLayer); ScTextBox text = new ScTextBox(scMgr); text.Location = new PointF(150, 0); text.Width = 200; text.Height = 30; root.Add(text); }
private void Form_Load(object sender, EventArgs e) { scMgr = new ScMgr(panel); scMgr.BackgroundColor = Color.FromArgb(255, 246, 245, 251); chartApp = new ChartApp(scMgr); scMgr.ReBulid(); }
ScLayer CreateItemControlFieldTest3(ScMgr scmgr, ColumnSetting columnSetting) { listView = new ScListView(scmgr); listView.Name = "ListView"; listView.IsUseShadow = false; listView.ShadowRange = 4; listView.Margin = new Margin(10, 10, 10, 10); listView.DisplayItemValue += DisplayItem; listView.CreateDefaultContentInfoSeting(); listView.Dock = ScDockStyle.Fill; ScLayer listViewPack; if (listView.IsUseShadow) { listViewPack = new ScLayer(); listViewPack.Name = "ListViewPack"; listViewPack.Dock = ScDockStyle.Fill; listViewPack.Add(listView); return(listViewPack); } else { return(listView); } }
ScLayer CreateItemControlFieldTest(ScMgr scmgr, ColumnSetting columnSetting) { ScLabel label = new ScLabel(scmgr); label.Dock = ScDockStyle.Fill; label.ForeFont = new D2DFont("微软雅黑", 17, SharpDX.DirectWrite.FontWeight.Bold); label.ForeColor = Color.FromArgb(255, 58, 166, 254); return(label); }
public ScChart(ScMgr scmgr = null) : base(scmgr) { textFormat = new TextFormat(D2DGraphics.dwriteFactory, "微软雅黑", 10) { TextAlignment = TextAlignment.Center, ParagraphAlignment = ParagraphAlignment.Center, WordWrapping = WordWrapping.Wrap }; SizeChanged += ScPanel_SizeChanged; D2DPaint += ScPanel_D2DPaint; MouseWheel += ScChart_MouseWheel; }
ScLayer CreateHeaderControlFieldTest(ScMgr scmgr, ColumnSetting columnSetting) { ScLabel label = new ScLabel(scmgr); label.Dock = ScDockStyle.Fill; label.ForeFont = new D2DFont("微软雅黑", 17, SharpDX.DirectWrite.FontWeight.Bold); if (!columnSetting.columnBaseInfo.isHideName) { label.Text = columnSetting.columnBaseInfo.displayName; } return(label); }
private ScLayer GridView_CreateHeaderTitleEvent(ScMgr scmgr) { ScLabel headerLabel = new ScLabel(scmgr); headerLabel.Name = "Title"; headerLabel.Dock = ScDockStyle.Fill; headerLabel.Text = "订单列表"; headerLabel.TextPadding = new Margin(20, 0, 0, 0); headerLabel.ForeFont = new D2DFont("微软雅黑", 35, SharpDX.DirectWrite.FontWeight.Bold); headerLabel.Alignment = TextAlignment.Leading; headerLabel.BackgroundColor = Color.FromArgb(100, 255, 0, 0); return(headerLabel); }
public TestLayer(ScMgr scmgr = null) : base(scmgr) { //设置层的阴影 shadow = new ScShadow(scmgr); shadow.CornersRadius = 4; shadow.ShadowRadius = 15; shadow.ShadowColor = Color.Black; ShadowLayer = shadow; SizeChanged += ScPanel_SizeChanged; D2DPaint += ScPanel_D2DPaint; MouseMove += TestLayer_MouseMove; }
private void Form1_Load(object sender, EventArgs e) { ////////////////////////////////////////// //透明无边框窗口测试代码,测试时打开下面的注释 //scMgr = new ScMgr(null, true); //scMgr.BackgroundColor = Color.FromArgb(100, 0, 0, 251); //app = new App(scMgr); //scMgr.ReBulid(); //scMgr.Show(); //////////////////////////////////// //常规窗口测试代码,测试时打开下面的注释 scMgr = new ScMgr(panel); scMgr.BackgroundColor = Color.FromArgb(255, 246, 245, 251); app = new App(scMgr); scMgr.ReBulid(); }
ScLayer CreateItemControlFieldTest1(ScMgr scmgr, ColumnSetting columnSetting) { ScLayer layer = new ScLayer(scmgr); layer.Dock = ScDockStyle.Fill; ScCheckBox checkBox = new ScCheckBox(scmgr); checkBox.CheckType = 0; checkBox.boxSideWidth = 1; checkBox.FillMargin = new Margin(2, 2, 3, 3); checkBox.CheckColor = Color.DarkRed; checkBox.Dock = ScDockStyle.Center; checkBox.Size = new SizeF(15, 15); checkBox.SetDrawCheckDirectParentLayer(layer); layer.Add(checkBox); return(layer); }
public GoodsListViewer(Control control) { scMgr = new ScMgr(control.Width, control.Height); scMgr.BackgroundColor = Color.FromArgb(255, 246, 245, 251); control.Controls.Add(scMgr.control); scMgr.control.Dock = DockStyle.Fill; root = scMgr.GetRootLayer(); root.Dock = ScDockStyle.Fill; // root.Padding = new Utils.Margin(100, 100, 100, 100); gridView = new ScGridView(scMgr); //样式设置 Setting(); //生成列 CreateColumnSetting(); root.Add(gridView); scMgr.ReBulid(); CreateBackDataList(); List <TestData> tmp = testDatalistFront; testDatalistFront = testDatalistBack; testDatalistBack = tmp; testDatalistBack.Clear(); UpdateDataSource(); // }
public ChartApp(ScMgr scMgr) { SF2 sf2 = new SF2("g:\\test.sf2"); List <short> samples = sf2.SoundChunk.SMPLSubChunk.samples; pcmProcesser = new PCMProcesser(); short[] newSamples = pcmProcesser.PitchPcmNote(samples.ToArray(), -24, true, 10); pcm_buffer = new byte[newSamples.Length * 2]; int idx = 0; for (int i = 0; i < newSamples.Length; i++) { pcm_buffer[idx++] = (byte)(newSamples[i] & 0xff); pcm_buffer[idx++] = (byte)((newSamples[i] >> 8) & 0xff); } List <short> shortBufs = new List <short>(); short val; for (int i = 0; i < pcm_buffer.Length; i += 2) { val = (short)((pcm_buffer[i + 1] << 8) | pcm_buffer[i]); shortBufs.Add(val); } List <float> floatBufs = new List <float>(); for (int i = 0; i < pcm_buffer.Length; i += 2) { val = (short)((pcm_buffer[i + 1] << 8) | pcm_buffer[i]); floatBufs.Add(val); } pcm = shortBufs.ToArray(); float[] seqDatas = pcmProcesser.CreatePcmFreqNormAmpSpectrum(pcm, 44100); List <float> samplesFloat = new List <float>(); for (int i = 0; i < shortBufs.Count; i++) { samplesFloat.Add(shortBufs[i]); } this.scMgr = scMgr; root = scMgr.GetRootLayer(); ScChart chart = new ScChart(scMgr); chart.GetAxisXSeq = GetAxisXSeq; chart.Datas = samplesFloat.ToArray(); // chart.DataLineColor = Color.Blue; // chart.XAxisColor = Color.White; // chart.DataRange = new DrawDataRange(0, 5000); chart.xAxisSeqCount = 10; chart.Dock = ScDockStyle.Fill; // chart.BackgroundColor = Color.Black; root.Add(chart); }