Created
July 8, 2017 15:56
-
-
Save 20chan/18fa14fa9f72d81a0f6d799982715177 to your computer and use it in GitHub Desktop.
Bitmap 을 Flatten하게 만들어서 1차원 배열로 만들어버리기
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
Bitmap b = new Bitmap(@"D:\Image\design\치워\히오스.png"); | |
var bitmapData = b.LockBits(new Rectangle(0, 0, b.Width, b.Height), System.Drawing.Imaging.ImageLockMode.ReadWrite, b.PixelFormat); | |
var length = bitmapData.Stride * bitmapData.Height; | |
byte[] bytes = new byte[length]; | |
// Copy bitmap to byte[] | |
Marshal.Copy(bitmapData.Scan0, bytes, 0, length); | |
b.UnlockBits(bitmapData); | |
System.Diagnostics.Debugger.Break(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment