private ImageList GetExistingImageList() { IContainer container = null; Form form = SuperMarquee.FindForm(); if (form != null) { container = form.Container; } else { if (SuperMarquee.Parent != null) { container = SuperMarquee.Parent.Container; } } if (container == null) { return(null); } ImageList imageList = null; for (int i = 0; i < container.Components.Count; i++) { if (container.Components[i] is ImageList) { imageList = (ImageList)container.Components[i]; break; } } return(imageList); }
public SuperMarqueDesignerActionList(IDesigner designer) : base(designer.Component) { SuperMarquee marquee = designer.Component as SuperMarquee; if (marquee != null) { marquee.Elements.Removed += delegate { marquee.Invalidate(); RefreshDisplay(); }; marquee.Elements.Inserted += delegate { marquee.Invalidate(); RefreshDisplay(); }; marquee.Elements.Cleared += delegate { marquee.Invalidate(); RefreshDisplay(); }; marquee.Elements.Changed += delegate { marquee.Invalidate(); RefreshDisplay(); }; } }
protected virtual void SetBackColor() { Color c = GetColor(SuperMarquee.BackColor); if (!c.IsEmpty) { SuperMarquee.BackColor = c; SuperMarquee.Invalidate(); } }
protected virtual void AddImageList() { ImageList imageList = GetExistingImageList(); if (imageList == null) { imageList = CreateNewImagelist(); } SuperMarquee.ImageList = imageList; SuperMarquee.Invalidate(); RefreshDisplay(); }
/// <summary> /// Create instance of <see cref="HitTestInfo"/>. Use this to get the HitTest information. /// </summary> /// <param name="control"><see cref="SuperMarquee"/> for which HitTest is to be performed.</param> /// <param name="testPoint">HitTest Point</param> public HitTestInfo(SuperMarquee control, Point testPoint) { if (control != null) { HitTestInfo test = control.HitTest(testPoint); index = test.index; point = test.point; area = test.area; } else { index = -1; point = testPoint; area = HitTestArea.None; } }
private ImageList CreateNewImagelist() { IContainer container = null; Form form = SuperMarquee.FindForm(); if (form != null) { container = form.Container; } else { if (SuperMarquee.Parent != null) { container = SuperMarquee.Parent.Container; } } if (container == null) { return(null); } ImageList imageList = new ImageList(container); return(imageList); }
protected virtual void Reset() { SuperMarquee.Reset(); SuperMarquee.Invalidate(); RefreshDisplay(); }
protected virtual void ShowStrip() { SuperMarquee.ShowStrip = !SuperMarquee.ShowStrip; SuperMarquee.Invalidate(); RefreshDisplay(); }
protected virtual void RemoveImageList() { SuperMarquee.ImageList = null; SuperMarquee.Invalidate(); RefreshDisplay(); }
protected virtual void AddElement() { SuperMarquee.Elements.Add(new TextElement()); SuperMarquee.Invalidate(); RefreshDisplay(); }
protected virtual void ClearElement() { SuperMarquee.Elements.Clear(); SuperMarquee.Invalidate(); RefreshDisplay(); }
internal void SetParent(SuperMarquee marquee) { parent = marquee; }
private void InitInfoRow() { bg = new Bitmap(ConfigObj.BackgroundImagePath);// Image.FromFile(ConfigObj.BackgroundImagePath); nearBus.Location = new Point(ConfigObj.NearBus.XOffset, ConfigObj.NearBus.YOffset); nearBus.Size = new Size(ConfigObj.NearBus.Width, ConfigObj.NearBus.Height); nearBus.MarqueeSpeed = 999; nearBus.BackColor = ConfigObj.NearBus.BGColor; nearBus.BackgroundImageLayout = ImageLayout.None; { TextElement element = new TextElement("Element text"); element.IsLink = false; element.ForeColor = ConfigObj.NearBus.FGColor; element.Text = " "; element.Tag = "Tag for element"; element.Font = new System.Drawing.Font(ConfigObj.NearBus.FontName /*"나눔고딕 ExtraBold"*/, ConfigObj.NearBus.FontSize /*40F*/, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Pixel, ((byte)(0))); nearBus.Elements.Add(element); nearBus.Visible = true; } this.Controls.Add(nearBus); if (nMarquees == null) { int rowCount = ConfigObj.Rows.Count; int cellCount = 0; if (rowCount > 0) { cellCount = ConfigObj.Rows[0].Cells.Count; } nMarquees = new SuperMarquee[rowCount * cellCount]; int cellNum = 0; foreach (InfoRow row in ConfigObj.Rows) { foreach (InfoCell cell in row.Cells) { nMarquees[cellNum] = new SuperMarquee(); nMarquees[cellNum].Location = new Point(cell.XOffset + row.XOffset, cell.YOffset + row.YOffset); nMarquees[cellNum].Size = new Size(cell.Width, cell.Height); nMarquees[cellNum].MarqueeSpeed = 999; nMarquees[cellNum].BackColor = cell.BGColor; nMarquees[cellNum].BackgroundImageLayout = ImageLayout.None; if (cellNum % 6 == 0) { if ((cellNum / 6) % 2 == 0) { nMarquees[cellNum].BackgroundImage = new Bitmap(ConfigBIT.BasePath + @"\Image\Vertical\저상버스.png"); } else { nMarquees[cellNum].BackgroundImage = new Bitmap(ConfigBIT.BasePath + @"\Image\Vertical\좌석버스.png"); } } else if (cellNum % 6 == 3) { nMarquees[cellNum].BackgroundImage = new Bitmap(ConfigBIT.BasePath + @"\Image\Vertical\ArriveTimeBack.png"); } else if (cellNum % 6 == 4) { nMarquees[cellNum].BackgroundImage = pictoImages[(cellNum / 6)];//new Bitmap(@"..\..\Image\Vertical\버스방향.png"); nMarquees[cellNum].BackgroundImageLayout = ImageLayout.Tile; } else if (cellNum % 6 == 5) { if ((cellNum / 6) % 2 == 0) { nMarquees[cellNum].BackgroundImage = new Bitmap(ConfigBIT.BasePath + @"\Image\Vertical\첫차.png"); } else { nMarquees[cellNum].BackgroundImage = new Bitmap(ConfigBIT.BasePath + @"\Image\Vertical\막차.png"); } } nMarquees[cellNum].Elements.Clear(); if (nMarquees[cellNum].BackgroundImage == null) { TextElement element = new TextElement("Element text"); element.IsLink = false; element.ForeColor = cell.FGColor; element.Text = "2412"; element.Tag = "Tag for element"; element.Font = new System.Drawing.Font(cell.FontName /*"나눔고딕 ExtraBold"*/, cell.FontSize /*40F*/, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Pixel, ((byte)(0))); element.ToolTipText = "Tool tip for element"; if (cellNum % 6 == 2) { element.StringFormat.Alignment = StringAlignment.Far; } nMarquees[cellNum].Elements.Add(element); nMarquees[cellNum].Elements.Add(element); nMarquees[cellNum].Visible = true; nMarquees[cellNum].Show(); } else { TextElement element = new TextElement("Element text"); element.IsLink = false; element.ForeColor = cell.FGColor; element.Text = " "; element.Tag = "Tag for element"; element.Font = new System.Drawing.Font(cell.FontName /*"나눔고딕 ExtraBold"*/, cell.FontSize /*40F*/, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Pixel, ((byte)(0))); element.ToolTipText = "Tool tip for element"; if (cellNum % 6 == 2) { element.StringFormat.Alignment = StringAlignment.Far; } nMarquees[cellNum].Elements.Add(element); nMarquees[cellNum].Visible = true; nMarquees[cellNum].Show(); } cellNum++; } } this.Controls.AddRange(nMarquees); for (int rowid = 0; rowid < ConfigObj.Rows.Count; rowid++) { for (int icell = 0; icell < ConfigObj.Rows[0].Cells.Count; icell++) { nMarquees[rowid * 6].Invoke((MethodInvoker) delegate { if (nMarquees[rowid * 6 + icell].Elements.Count > 1) { nMarquees[rowid * 6 + icell].Elements.RemoveAt(1); } nMarquees[rowid * 6 + icell].Elements[0].Text = string.Empty; nMarquees[rowid * 6 + icell].BackgroundImage = null; }); } } axWindowsMediaPlayer.Location = new Point(0, 767); axWindowsMediaPlayer.Size = new Size(768, 1289 - 767); // TODO 파일 명 바꾸기 string scfile = ConfigBIT.BasePath + @"/DB/SNRDB/20151016"; using (BinaryReader brBinaryReader = new BinaryReader(File.Open(scfile, FileMode.Open))) { FileInfo f = new FileInfo(scfile); long s1 = f.Length; if ((s1 - 5) % 35 == 0) { Scenario_DataPlain fileData = new Scenario_DataPlain(); fileData.SetDataFrom(brBinaryReader); foreach (var item in fileData.formData) { MediaFileInfo mInfo = new MediaFileInfo(); mInfo.fileName = ConfigBIT.BasePath + @"/DB/SNR/" + item.fileName; mInfo.durSeconds = item.durationSecond; mInfo.fileType = item.dataType; mediaList.Add(mInfo); } if (mediaList.Count > 0) { WMPLib.IWMPPlaylist playlist = axWindowsMediaPlayer.playlistCollection.newPlaylist("myplaylist"); WMPLib.IWMPMedia media; foreach (var file in mediaList) { media = axWindowsMediaPlayer.newMedia(file.fileName); playlist.appendItem(media); } axWindowsMediaPlayer.settings.setMode("loop", true); axWindowsMediaPlayer.currentPlaylist = playlist; axWindowsMediaPlayer.Ctlcontrols.play(); axWindowsMediaPlayer.settings.mute = true; axWindowsMediaPlayer.stretchToFit = true; /* * dropCnt = mediaList[0].durSeconds; * curMedia = mediaList[0].fileName; * axWindowsMediaPlayer.Visible = true; * axWindowsMediaPlayer.URL = curMedia; * * axWindowsMediaPlayer.Ctlcontrols.play(); */ } } else { Scenario_DataSchedule fileData = new Scenario_DataSchedule(); fileData.SetDataFrom(brBinaryReader); } } } }