Beispiel #1
0
		// lädt Images mit zufälligem Dateinamen (aus angegebenem Directory) in den ImageContainer
		private void LoadImages(string[] filenames) 
		{
			Cursor prevCursor;
			int i;
			int nrButtons = settings.NrButtonsX*settings.NrButtonsY;
			int width = GamePanel.Width/settings.NrButtonsX - DIST_X;
			int height = GamePanel.Height/settings.NrButtonsY - DIST_Y;
			string filename;
			//			string dir = this.txtDir.Text;			

			images = new ImageContainer(settings.NrButtonsX * settings.NrButtonsY);

			//			progressBar1.Value = 0;
			//			progressBar1.Maximum = NR_BUTTONS;
			//			progressBar1.Visible = true;
			prevCursor = this.Cursor;
			this.Cursor = Cursors.WaitCursor;
			for (i = 0; i < nrButtons/2; i++) 
			{
				filename = filenames[i];
				if (settings.FitToSize) 
				{		
					images.AddImageStretched(filename, width, height, settings.AspectRatio);
				}
				else 
				{			
					images.AddImageClipped(filename, width, height);
				}
				lblStatus.Text = "Loading \"" + filename + "\"";
				lblStatus.Refresh();
				//			progressBar1.Value++;
				//			progressBar1.Refresh();
			}
			// images der "doppelgänger" setzen
			for (i = 0; i < nrButtons/2; i++)
			{
				images.AddImage (images[indexesOfPairs[i]]);
			}
			//			progressBar1.Visible = false;
			this.Cursor = prevCursor;
		}
Beispiel #2
0
			public MyEnumerator(ImageContainer coll) 
			{
				collection = coll;
				nIndex = -1;
			}