Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
理由はわかりませんが、最初のピクセル (左下) は正しく読み込まれますが、他のピクセルは読み込まれず、最初の色が画像全体に使用されます...
私はこれをサイクルで持っています
fread(&pix,sizeof(pix),1,pictureIn); fwrite(&pix,sizeof(pix),1,pictureOut);
編集:
pix は 3 つの符号なし文字 (rgb) の構造体で、ファイルと情報ヘッダーの読み込みは問題ないようです
どのOSを使用していますか?最近、Win32 でのバイナリ ファイルの読み取りに問題がありました。「b」フラグを fopen に渡すのを忘れていたことが判明しました。
pictureIn = fopen ("in.bmp", "rb"); pictureOut = fopen ("out.bmp", "wb");