예제 #1
0
        static void Main()
        {
            Iup.Open();
            IupControls.Open();
            IupGL.Open();

            IupHandle button, bkbox;


            using (IupHandle dlg = Iup.Dialog(
                       Iup.Vbox(
                           LabelText("Namn:"),
                           LabelText("Adress:"),
                           LabelText("Gata:"),
                           button = Iup.Button("OK")
                           ).SetAttributes("ALIGNMENT=ARIGHT,NGAP=4")

                       )
                   )
            {
                //openitem.SetCallback ("K_cO", new CallbackKeyPressCB (OnKeyPress));


                byte[] img = new byte[100 * 100 * 3];
                img[10] = 25;
                IupHandle iupimg = Iup.ImageRGB(100, 100, img);



                var ep = Iup.ElementPropertiesDialog(button);
                ep.Show();


                dlg.Show();
                Iup.MainLoop();
            }



            Iup.Close();
        }
예제 #2
0
        private void Create(int w, int h, GlyphMode mode, byte[] pixelData, Color[] palette)
        {
            switch (mode)
            {
            case GlyphMode.RGB: Init(Iup.ImageRGB(w, h, pixelData)); break;

            case GlyphMode.RGBA: Init(Iup.ImageRGBA(w, h, pixelData)); break;

            case GlyphMode.Indexed:
            default:
                Init(Iup.Image(w, h, pixelData));

                if (palette != null)
                {
                    for (int i = 0; i < palette.Length; i++)
                    {
                        Handle.SetStrAttribute(Format.Int(i), Format.Color(palette[i]));
                    }
                }

                break;
            }
        }