//Rainbow Filter private void colorFilterButton_Click(object sender, EventArgs e) { if (coloredFilterApplied) { putImageBackToOriginal(); } else { picPreview.Image = picPreview.Image; picPreview.Image = ImageFilter.RainbowFilter(new Bitmap(previewBitmap)); previewBitmap = ImageFilter.RainbowFilter(new Bitmap(previewBitmap)); coloredFilterApplied = true; } }
//Crazy Filter button private void crazyFilterButton_Click(object sender, EventArgs e) { if (coloredFilterApplied) { putImageBackToOriginal(); } else { picPreview.Image = picPreview.Image; picPreview.Image = ImageFilter.ApplyFilterSwapDivide(new Bitmap(previewBitmap), 1, 1, 2, 1); picPreview.Image = ImageFilter.ApplyFilterSwap(new Bitmap(previewBitmap)); previewBitmap = ImageFilter.ApplyFilterSwap(new Bitmap(previewBitmap)); coloredFilterApplied = true; } }