示例#1
0
        public Editor(PckImage curr)
        {
            edit    = new EditorPanel(curr);
            buttons = new ButtonPanel();
            size    = new TrackBar();

            size.Minimum = 1;
            size.Maximum = 10;

            InitializeComponent();

            Controls.Add(edit);
            Controls.Add(buttons);
            Controls.Add(size);

            buttons.Location = new Point(0, 0);
            buttons.Width    = buttons.PreferredWidth;

            size.Left = buttons.Right;
            size.Top  = buttons.Top;
            edit.Top  = size.Bottom;
            edit.Left = buttons.Right;

            ClientSize = new Size(
                buttons.PreferredWidth + edit.Editor.PreferredWidth,
                edit.Editor.PreferredHeight + size.Height);

            palView          = new PalView();
            palView.Closing += new CancelEventHandler(palClose);

            palView.PaletteIndexChanged += new PaletteClickDelegate(edit.Editor.SelectColor);
            size.Scroll += new EventHandler(sizeScroll);
        }
示例#2
0
        public static xCollection FromBmp(Bitmap b)
        {
            PckImage.Scale = 1;
            switch (b.PixelFormat)
            {
            case PixelFormat.Format8bppIndexed:
                break;

            case PixelFormat.Format24bppRgb:
                PckImage.Scale = 2;
                break;
            }

            int space = PckFile.imgSpace * PckImage.Scale;

            ArrayList list = new ArrayList();

            int cols = (b.Width + space) / (PckImage.Width + space);
            int rows = (b.Height + space) / (PckImage.Height + space);

            int num = 0;

            for (int y = 0; y < b.Height; y += PckImage.Height + space)
            {
                for (int x = 0; x < b.Width; x += PckImage.Width + space)
                {
                    try
                    {
                        switch (b.PixelFormat)
                        {
                        case PixelFormat.Format8bppIndexed:
                            list.Add(PckImage.FromBMP(b, num++, Palette.TFTDBattle, x, y));
                            break;

                        case PixelFormat.Format24bppRgb:
                            list.Add(PckImage.FromBMP24(b, num++, Palette.TFTDBattle, x, y));
                            break;
                        }

                        Bmp.FireLoadingEvent(num, rows * cols);
                    }
                    catch {}
                }
            }

            return(new PckFile(list));
        }
示例#3
0
 public ByteView(PckImage img)
 {
     InitializeComponent();
     image = img;
     printData();
 }
示例#4
0
 public static ITile FromBmpSingle(Bitmap b, int num, Palette p)
 {
     return(PckImage.FromBMP(b, num, p, 0, 0));
 }
示例#5
0
		public ByteView(PckImage img)
		{
			InitializeComponent();
			image = img;
			printData();
		}