示例#1
0
        //--------------------------------------------------------------------
        // Purpose:
        //     Save the icon
        //
        // Notes:
        //     None.
        //--------------------------------------------------------------------
        private void SaveIcon(string fileName)
        {
            Bitmap newBitmap256 = new Bitmap(s256Consts[MAX_WIDTH], s256Consts[MAX_HEIGHT], System.Drawing.Imaging.PixelFormat.Format24bppRgb);
            Bitmap newBitmap128 = new Bitmap(s128Consts[MAX_WIDTH], s128Consts[MAX_HEIGHT], System.Drawing.Imaging.PixelFormat.Format24bppRgb);
            Bitmap newBitmap064 = new Bitmap(s64Consts[MAX_WIDTH], s64Consts[MAX_HEIGHT], System.Drawing.Imaging.PixelFormat.Format24bppRgb);
            Bitmap newBitmap032 = new Bitmap(s32Consts[MAX_WIDTH], s32Consts[MAX_HEIGHT], System.Drawing.Imaging.PixelFormat.Format24bppRgb);
            Bitmap newBitmap016 = new Bitmap(s16Consts[MAX_WIDTH], s16Consts[MAX_HEIGHT], System.Drawing.Imaging.PixelFormat.Format24bppRgb);

            Graphics graph256 = Graphics.FromImage(newBitmap256);
            Graphics graph128 = Graphics.FromImage(newBitmap128);
            Graphics graph064 = Graphics.FromImage(newBitmap064);
            Graphics graph032 = Graphics.FromImage(newBitmap032);
            Graphics graph016 = Graphics.FromImage(newBitmap016);

            drawIt(graph256, 0, 0, s256Consts, bm256Consts);
            drawIt(graph128, 0, 0, s128Consts, bm128Consts);
            drawIt(graph064, 0, 0, s64Consts, bm64Consts);
            drawIt(graph032, 0, 0, s32Consts, bm32Consts);
            drawIt(graph016, 0, 0, s16Consts, bm16Consts);

            // We need to save the bitmaps inorder to read them in as a raw binary file
            newBitmap256.Save("NewIcon256.bmp", System.Drawing.Imaging.ImageFormat.Bmp);
            newBitmap128.Save("NewIcon128.bmp", System.Drawing.Imaging.ImageFormat.Bmp);
            newBitmap064.Save("NewIcon64.bmp", System.Drawing.Imaging.ImageFormat.Bmp);
            newBitmap032.Save("NewIcon32.bmp", System.Drawing.Imaging.ImageFormat.Bmp);
            newBitmap016.Save("NewIcon16.bmp", System.Drawing.Imaging.ImageFormat.Bmp);

            // Create the icon file and add five icon to it
            jimsIcon newIcon = new jimsIcon(5);

            newIcon.add("NewIcon256.bmp");
            newIcon.add("NewIcon128.bmp");
            newIcon.add("NewIcon64.bmp");
            newIcon.add("NewIcon32.bmp");
            newIcon.add("NewIcon16.bmp");

            newIcon.save(fileName);
        }
示例#2
0
        //--------------------------------------------------------------------
        // Purpose:
        //     Test code to parse the icon file
        //
        // Notes:
        //     None.
        //--------------------------------------------------------------------
        private void bTest_Click(object sender, EventArgs e)
        {
            jimsIcon newIcon = new jimsIcon();

            newIcon.load("F:\\star\\1432_PSU\\Prototype\\tools\\IconBuilder\\IconBuilder\\TestIcon.ico");
        }