示例#1
0
        private void uploadToLEDBoardToolStripMenuItem_Click(object sender, EventArgs e)
        {
            solution.SaveAll();
            lb_manager      = new LED_Board_Manager();
            lb_manager.Size = new Size(425, 180);

            string ProjectFileName = solution.GetItemPath(solution.GetProject());

            lb_manager.AddFile(ProjectFileName);
            foreach (IDocument item in solution.GetProjectItems(solution.GetProject()))
            {
                Document document = solution.GetItemDocument(item);
                string   path     = document.GetPath();
                lb_manager.AddFile(path);
                if (item.GetType() == typeof(Theme))
                {
                    Theme theme = item as Theme;
                    foreach (LB_Tools_Interface tool in theme.GetTools())
                    {
                        string tool_res;

                        if (tool.GetType() == typeof(LB_Tools_Text))
                        {
                            LB_Tools_Text tool_text = tool as LB_Tools_Text;
                            tool_res = Path.GetDirectoryName(ProjectFileName) + "\\" + "LB_Tools_Text_" + tool_text.Text_Name + ".bma";
                            tool_text.SetLBResourcePath(tool_res);
                            AnimationConverter animationConverter = new AnimationConverter(tool_text.GetBitmap());
                            if (animationConverter.Encode(tool_res, 0, 0, AnimationConverter.ColorOrder.RGB, AnimationConverter.PixelOrder.VS_TR, AnimationConverter.DataType.Default))
                            {
                                lb_manager.AddFile(tool_res);
                            }
                        }
                        else if (tool.GetType() == typeof(LB_Tools_RunningText))
                        {
                            LB_Tools_RunningText tool_rtext = tool as LB_Tools_RunningText;
                            tool_res = Path.GetDirectoryName(ProjectFileName) + "\\" + "LB_Tools_Text_" + tool_rtext.Text_Name + ".bma";
                            CloseTabIfOpened(theme);
                            if (tool_rtext.SaveAsBMA(tool_res))
                            {
                                lb_manager.AddFile(tool_res);
                            }
                        }
                        else
                        {
                            tool_res = tool.GetLBResourcePath();
                            if (tool_res != "")
                            {
                                lb_manager.AddFile(tool_res);
                            }
                        }
                    }
                }
            }


            lb_manager.Show();
        }
示例#2
0
        private Bitmap GetBitmap()
        {
            Bitmap bitmap = new Bitmap(SizeX, SizeY);

            ClearBitmap(bitmap, theme.BackColor);

            foreach (object tool in theme.GetTools())
            {
                if (tool != null && tool.GetType() == typeof(LB_Tools_Text))
                {
                    LB_Tools_Text lb_tools_text = (LB_Tools_Text)tool;
                    CopyBitmapWithTransparentKey(bitmap, lb_tools_text.GetBitmap(), lb_tools_text.position, theme.TransparentKey);
                }
                else if (tool != null && tool.GetType() == typeof(LB_Tools_Clock))
                {
                    LB_Tools_Clock lb_tools_clock = tool as LB_Tools_Clock;
                    CopyBitmapWithTransparentKey(bitmap, lb_tools_clock.GetBitmap(), lb_tools_clock.position, theme.TransparentKey);
                }
                else if (tool != null && tool.GetType() == typeof(LB_Tools_Image))
                {
                    LB_Tools_Image lb_tools_clock = tool as LB_Tools_Image;
                    CopyBitmapWithTransparentKey(bitmap, lb_tools_clock.GetBitmap(), lb_tools_clock.position, theme.TransparentKey);
                }
                else if (tool != null && tool.GetType() == typeof(LB_Tools_Animation))
                {
                    LB_Tools_Animation lb_tools_clock = tool as LB_Tools_Animation;
                    CopyBitmapWithTransparentKey(bitmap, lb_tools_clock.GetBitmap(), lb_tools_clock.position, theme.TransparentKey);
                }
                else if (tool != null && tool.GetType() == typeof(LB_Tools_RunningText))
                {
                    LB_Tools_RunningText lb_tools_clock = tool as LB_Tools_RunningText;
                    CopyBitmapWithTransparentKey(bitmap, lb_tools_clock.GetBitmap(), lb_tools_clock.position, theme.TransparentKey);
                }
                else if (tool != null && tool.GetType() == typeof(LB_Tools_TimeSecProgressBar))
                {
                    LB_Tools_TimeSecProgressBar lb_tools_clock = tool as LB_Tools_TimeSecProgressBar;
                    CopyBitmapWithTransparentKey(bitmap, lb_tools_clock.GetBitmap(), lb_tools_clock.position, theme.TransparentKey);
                }
            }
            return(bitmap);
        }