Note that there are some explanatory texts on larger screens.

plurals
  1. POinsert image ,grayscale and wipe transition in c#
    primarykey
    data
    text
    <p>i have been developed a windows application in c# this app has three buttons (open,save,grayscale) and has picture box to display the picture in the application</p> <pre><code> using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Drawing.Imaging; namespace MyFirstWindowsApplication { public partial class Form1 : Form { Bitmap newbitmap; Bitmap newbitmap2; Bitmap outp; Image file; public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { DialogResult dr = openFileDialog1.ShowDialog(); if (dr == DialogResult.OK) { file = Image.FromFile(openFileDialog1.FileName); newbitmap = new Bitmap(openFileDialog1.FileName); newbitmap2 = new Bitmap(openFileDialog1.FileName); outp = new Bitmap(openFileDialog1.FileName); pictureBox1.Image = file; } } private void button2_Click(object sender, EventArgs e) { DialogResult dr = saveFileDialog1.ShowDialog(); if (dr == DialogResult.OK) { if (newbitmap != null) { if (saveFileDialog1.FileName.Substring(saveFileDialog1.FileName.Length - 3).ToLower() == "bmp") { newbitmap.Save(saveFileDialog1.FileName, ImageFormat.Bmp); } if (saveFileDialog1.FileName.Substring(saveFileDialog1.FileName.Length - 3).ToLower() == "jpg") { newbitmap.Save(saveFileDialog1.FileName, ImageFormat.Bmp); } if (saveFileDialog1.FileName.Substring(saveFileDialog1.FileName.Length - 3).ToLower() == "bmp") { newbitmap.Save(saveFileDialog1.FileName, ImageFormat.Jpeg); } if (saveFileDialog1.FileName.Substring(saveFileDialog1.FileName.Length - 4).ToLower() == "jpeg") { newbitmap.Save(saveFileDialog1.FileName, ImageFormat.Jpeg); } if (saveFileDialog1.FileName.Substring(saveFileDialog1.FileName.Length - 3).ToLower() == "png") { newbitmap.Save(saveFileDialog1.FileName, ImageFormat.Png); } if (saveFileDialog1.FileName.Substring(saveFileDialog1.FileName.Length - 3).ToLower() == "gif") { newbitmap.Save(saveFileDialog1.FileName, ImageFormat.Gif); } } else { MessageBox.Show("you need to open file first"); } } } private void button3_Click(object sender, EventArgs e) { for (int x = 0; x &lt; newbitmap.Width; x++) { for (int y = 0; y &lt; newbitmap.Height; y++) { Color originalColor = newbitmap.GetPixel(x, y); int grayscale = (int)((originalColor.R * .3) + (originalColor.G * .59) + (originalColor.B * .11)); Color newColor = Color.FromArgb(grayscale, grayscale, grayscale); newbitmap.SetPixel(x, y, newColor); } } int tmax = 10; int xmax=newbitmap.Width; int ymax=newbitmap.Height; for (int t = 0; t &lt;= tmax; t += 1) { for (int x = 0; x &lt; xmax; x++) { for (int y = 0; y &lt; ymax; y++) { if ((x / xmax) &gt; (t / tmax)) { Color originalco = newbitmap2.GetPixel(x, y); outp.SetPixel(x, y, originalco); } else { Color originalco3 = newbitmap.GetPixel(x, y); ; outp.SetPixel(x, y, originalco3); } pictureBox1.Image = outp; } } } } } } </code></pre> <p>the problem is doesnt make the wipe transition </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload