Created
November 7, 2019 14:58
-
-
Save ImagingSolution/e9fed2638ecc3873e8440504f37bab1e to your computer and use it in GitHub Desktop.
【C#】画像の輝度値の取得設定速度の比較
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pictureBox1.SizeMode = PictureBoxSizeMode.Zoom; | |
var bmp = new Bitmap(@"C:\Temp\syurijou.JPG"); // 6000 x 4000 x 24bit | |
pictureBox1.Image = bmp; | |
var sw = new System.Diagnostics.Stopwatch(); | |
MessageBox.Show("開始"); | |
sw.Start(); | |
// GetPixel、SetPixel | |
NegativeImage1(bmp); | |
sw.Stop(); | |
pictureBox1.Refresh(); | |
MessageBox.Show($"NegativeImage1: {sw.ElapsedMilliseconds} msec"); | |
sw.Reset(); | |
sw.Start(); | |
// 配列を介す方法 | |
NegativeImage2(bmp); | |
sw.Stop(); | |
pictureBox1.Refresh(); | |
MessageBox.Show($"NegativeImage2: {sw.ElapsedMilliseconds} msec"); | |
sw.Reset(); | |
sw.Start(); | |
// MershalのReadByte、WriteByte | |
NegativeImage3(bmp); | |
sw.Stop(); | |
pictureBox1.Refresh(); | |
MessageBox.Show($"NegativeImage3: {sw.ElapsedMilliseconds} msec"); | |
sw.Reset(); | |
sw.Start(); | |
// usafeのポインタ | |
NegativeImage4(bmp); | |
sw.Stop(); | |
pictureBox1.Refresh(); | |
MessageBox.Show($"NegativeImage4: {sw.ElapsedMilliseconds} msec"); | |
sw.Reset(); | |
sw.Start(); | |
// usafeのポインタの並列処理 | |
NegativeImage5(bmp); | |
sw.Stop(); | |
pictureBox1.Refresh(); | |
MessageBox.Show($"NegativeImage5: {sw.ElapsedMilliseconds} msec"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
【C#】画像の輝度値の取得設定速度の比較
https://imagingsolution.net/program/set_get_bright_speed/