Example #1
0
        private void Form1_Load(object sender, System.EventArgs e)
        {
            // Splash will contain the per-pixel-alpha dib
            Splash = new MyPerPixelAlphaForm(this);
            Splash.Show();
            Bitmap btm = (Bitmap)this.pictureBox1.Image;

            Splash.SetBitmap(btm, 255);
        }
Example #2
0
    ///<para>Constructs and initializes all child controls of this dialog box.</para>
    private void InitializeComponent()
    {
        // Label with to display current opacity level
        Label Label1 = new Label();

        Label1.AutoSize = true;
        Label1.Location = new System.Drawing.Point(4, 8);
        Label1.Text     = "1. Drag&&Drop an image file from windows explorer into this window.";
        Controls.Add(Label1);

        Label Label2 = new Label();

        Label2.AutoSize = true;
        Label2.Location = new System.Drawing.Point(4, 38);
        Label2.Text     = "2. Play with the opacity level [0..255]:";
        Controls.Add(Label2);

        // Label with to display current opacity level
        LabelValue          = new Label();
        LabelValue.AutoSize = true;
        LabelValue.Location = new System.Drawing.Point(195, 38);
        LabelValue.Text     = "255";

        Controls.Add(LabelValue);


        // Trackbar to change opacity level
        Track = new TrackBar();

        Track.Location = new System.Drawing.Point(18, 58);
        Track.Size     = new System.Drawing.Size(310, 0);
        Track.BeginInit();
        Track.Maximum       = 255;
        Track.TickFrequency = 5;
        Track.TickStyle     = TickStyle.TopLeft;
        Track.Value         = 255;
        Track.EndInit();

        Track.ValueChanged += new EventHandler(Track_ValueChanged);

        Controls.Add(Track);


        Label Label3 = new Label();

        Label3.AutoSize = true;
        Label3.Location = new System.Drawing.Point(4, 108);
        Label3.Text     = "3. Drag the layered window arround you desktop!";
        Controls.Add(Label3);


        // Label with two links to me! :)
        LinkLabel Link = new LinkLabel();

        Link.Location = new System.Drawing.Point(4, 140);
        Link.Size     = new System.Drawing.Size(250, 80);
        Link.Text     = "by Rui Lopes <*****@*****.**>";
        Link.Links.Add(3, 9, "http://www.ruilopes.com");
        Link.Links.Add(14, 16, "mailto:[email protected]");

        Link.LinkClicked += new LinkLabelLinkClickedEventHandler(Link_LinkClicked);

        Controls.Add(Link);


        // TestForm will containt the per-pixel-alpha dib
        TestForm = new MyPerPixelAlphaForm();
        TestForm.Show();
    }