private void addToLibrary(MagickImage fileImage) { MovablePicBox newPicture = createThumbnail(fileImage.ToBitmap()); newPicture.Location = new Point(thumbnailX * currentColumn + imageLibrary.Location.X, thumbnailY * currentRow + imageLibrary.Location.Y); if (currentColumn >= 2) { currentColumn = 0; currentRow++; } else { currentColumn++; } this.Controls.Add(newPicture); newPicture.BringToFront(); newPicture.MouseDown += new MouseEventHandler(libraryPicture_MouseDown); newPicture.MouseUp += new MouseEventHandler(libraryPicture_MouseUp); fileImage.AnimationDelay = 30; libraryList.Add(fileImage); previewBox.Image = libraryList.ToBitmap(ImageFormat.Gif); }
private MovablePicBox createThumbnail(Image image) { MovablePicBox newPicture = new MovablePicBox(); newPicture.Image = image; newPicture.SizeMode = PictureBoxSizeMode.Zoom; newPicture.BorderStyle = BorderStyle.FixedSingle; newPicture.Size = new Size(thumbnailX, thumbnailY); newPicture.BackColor = Color.White; return(newPicture); }