というのを書きましたが、あれはダメですね。遅すぎです。C#でもポインタは使えますので、下記のように書けばOKです。
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
unsafe { | |
byte* b = mm.DataPointer; | |
for (int i = 0; i < height; i++) { //for文は1つにまとめていいんだが | |
for (int j = 0; j < width; j++) { | |
b[0] = 255; //B | |
b[1] = 255; //G | |
b[2] = 255; //R | |
b = b + 3; | |
} | |
} | |
} |
0 件のコメント:
コメントを投稿