Click here to Skip to main content
15,895,746 members
Articles / Desktop Programming / Windows Forms

Crystal Image Toolkit: thumbnail image control and picture viewing.

Rate me:
Please Sign up or sign in to vote.
4.68/5 (21 votes)
11 May 2011LGPL37 min read 110K   8.3K   95  
Thumbnail and image viewing controls for Windows Forms, using C#.
using System;
using System.Windows.Forms;

namespace CrystalTrackBarDemo
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void exitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            //crystalToolStripTrackBar1.Value = 5;
            crystalToolStripTrackBar1.CrystalTrackBar.KeyboardControl = false;

            labelToolStripTrackBar.Text = toolStripTrackBar1.Value.ToString();
            labelCrystalToolstrip.Text = crystalToolStripTrackBar1.Value.ToString();
            labelTrackBar1.Text = crystalTrackBar1.Value.ToString();
            labelTrackBar2.Text = crystalTrackBar2.Value.ToString();
            labelTrackBar3.Text = crystalTrackBar3.Value.ToString();
        }

        private void toolStripTrackBar1_ValueChanged(object sender, EventArgs e)
        {
            labelToolStripTrackBar.Text = toolStripTrackBar1.Value.ToString();
        }

        private void crystalToolStripTrackBar1_ValueChanged(object sender, EventArgs e)
        {
            labelCrystalToolstrip.Text = crystalToolStripTrackBar1.Value.ToString();
        }

        private void crystalTrackBar1_ValueChanged(object sender, EventArgs e)
        {
            labelTrackBar1.Text = crystalTrackBar1.Value.ToString();
        }

        private void crystalTrackBar2_ValueChanged(object sender, EventArgs e)
        {
            labelTrackBar2.Text = crystalTrackBar2.Value.ToString();
        }

        private void crystalTrackBar3_ValueChanged(object sender, EventArgs e)
        {
            labelTrackBar3.Text = crystalTrackBar3.Value.ToString();
        }

        private void crystalTrackBar4_ValueChanged(object sender, EventArgs e)
        {
            labelTrackBar4.Text = crystalTrackBar4.Value.ToString();
        }

        private void Form1_SizeChanged(object sender, EventArgs e)
        {
            // HACK or NOT?
            // The transparent trackbar on the toolstrip has a problem
            // when the toolstrip is resized: it gets invalidated.
            // The toolstrip doesn't seem to communicate resize events
            // to the toolstrip control host object.
            // Therefore, when a resize event occurs, tell the trackbar
            // to repaint itself.
            // NOTE: a CrystalToolStripTrackBar object with TransparentMode
            // set to false, won't have this problem.
            crystalToolStripTrackBar1.CrystalTrackBar.RedrawTrackBar();
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU Lesser General Public License (LGPLv3)


Written By
Software Developer (Senior)
United States United States
Richard has been working with Windows software since 1991. He has worked for Borland, Microsoft, Oracle, and various startup companies such as Livescribe. Currently he is developing projects in C#, Windows Forms, and Net Framework. Visit his blog Attilan (www.attilan.com) to learn more about his tools, projects and discoveries.

Comments and Discussions