|
|
|
|
|
[Home][7 Image Display][7.3 Buttons]
|
7.3 Implementing ButtonsIn 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:
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. |