7.3 Buttons
About1 Introduction2 Image Recognition3 TransApplet4 API5 Interface6 Input7 Image Display8 Preprocessing9 Processing10 Normalization11 Parameter Class12 Image Signatures13 Unsupervised Filters14 BioFilters15 NeuralFilters16 Dynamic Library17 NeuralNet Filter18 Parameters19 Input Options20 Database Input21 Video Input22  Live Video Input23  Counting & Tracking24  Counting 25  Batch Job26 ImageFinder for DOS27 ImageHunt 28 Support Packages

7.1 Class Name 
7.2 Class Link 
7.3 Buttons 
7.4 Test 
7.5 Output 

 

 

[Home][7 Image Display][7.3 Buttons]

 

7.3   Implementing Buttons

In this section, we will implement the First, Next, and Previous buttons.

To see images in a search source, start with the �First� button and then, keep clicking the �Next� button to display the next image; eventually, all of the images in the search source will be shown.

The code for the three buttons consists of three parts:

  •    Populating ImageList70 Object;
  •    Functions for buttons, which in turn will call functions in the Input objects;
  •    Implementation functions in the Input objects.

First of all, the ImageList70 object has to be populated. This can be accomplished by adding a single line of code in the last chapter:

        private void searchSource0 ()

                {

                    �

                    f.pictureBox2.Image = new Bitmap  (filelist[0] );

                    f.richTextBox1.AppendText ( "Display the first image!\n" );

                    imageAbsoultePathList.setList ( filelist );

                }

         

        private void searchSource1 ()

                {

                    �

                    f.pictureBox2.Image = new Bitmap  (filelist[0] );

                    f.richTextBox1.AppendText ( "Display the first image!\n" );

                    imageAbsoultePathList.setList ( filelist );

                }

         

        private void searchSource2 ()

                {

                    �

                    f.pictureBox2.Image = new Bitmap  (filelist[0] );

                    f.richTextBox1.AppendText ( "Display the first image!\n" );

                     imageAbsoultePathList.setList ( filelist );

                }

         

        private void searchSource3 ()

                {

                    �

                    f.pictureBox2.Image = new Bitmap  (filelist[0] );

                    f.richTextBox1.AppendText ( "Display the first image!\n" );

                    imageAbsoultePathList.setList ( filelist );

                }

Secondly, the code for the �First� button is:

      private void button5_Click(object sender, System.EventArgs e)

              {

                  input.firstButton( iMode );

              }

Similarly, the code for the �Next� button and the �Previous� button are:

      private void button6_Click(object sender, System.EventArgs e)

              {

                  input.nextButton ( iMode );

              }

       

          private void button7_Click(object sender, System.EventArgs e)

              {

                  input.previousButton ( iMode );

              }

Finally, in the Input class, these functions are implemented:

      public void firstButton (int iMode)

              {

                  try

                  {

                  appendText ( imageAbsoultePathList.getFirst ()+"\n"   );

                  bSearch =new Bitmap ( imageAbsoultePathList.getFirst () );

                  f.pictureBox2.Image = bSearch;

                  }

                  catch

                  {

                      appendText ("Invalid image!\n");

                      return;

                  }

              }

       

          public void nextButton (int iMode)

              {

                  try

                  {

                  appendText ( imageAbsoultePathList.getNext  () +"\n"   );

                  bSearch =new Bitmap ( imageAbsoultePathList.getNext  () );

                  f.pictureBox2.Image = bSearch;

                  }

                  catch

                  {

                      appendText ("Invalid image!\n");

                      return;

                  }

              }

       

              public void previousButton (int iMode)

              {

                  try

                  {

                  appendText ( imageAbsoultePathList.getPrevious () +"\n"  );

                  bSearch =new Bitmap ( imageAbsoultePathList.getPrevious () );

                  f.pictureBox2.Image = bSearch;

                  }

                  catch

                  {

                      appendText ("Invalid image!\n");

                      return;

                  }

              }

 

[Home][About][1 Introduction][2 Image Recognition][3 TransApplet][4 API][5 Interface][6 Input][7 Image Display][8 Preprocessing][9 Processing][10 Normalization][11 Parameter Class][12 Image Signatures][13 Unsupervised Filters][14 BioFilters][15 NeuralFilters][16 Dynamic Library][17 NeuralNet Filter][18 Parameters][19 Input Options][20 Database Input][21 Video Input][22 Live Video Input][23 Counting & Tracking][24 Counting ][25 Batch Job][26 ImageFinder for DOS][27 ImageHunt ][28 Support Packages]

Copyright (c) 2006 - 2007 Attrasoft. All rights reserved.

gina@attrasoft.com