Access to bytes array of a Bitmap
        Posted  
        
            by 
                Deulis
            
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Deulis
        
        
        
        Published on 2012-10-21T16:43:25Z
        Indexed on 
            2012/10/21
            17:00 UTC
        
        
        Read the original article
        Hit count: 239
        
1- In Windows CE, I have a Bitmap object in C#.
2- I have a C function in an extern dll that expects as parameters the pointer to a bytes array that represents an image in RGB565 format, width and height. This function will draw on this array of bytes.
So I need to pass the byte array pointer of the Bitmap object, but I can find a practical way to get this pointer. One way is convert this Bitmap into a bytes array using a memory stream or something else, but it will create a new bytes array, so I will keep in memory both object, the Bitmap and the bytes array, but I don’t want it because the few available memory, that’s why I need to access to the bytes array of the bitmap object, not create a new bytes array.
Anyone can help me?
© Stack Overflow or respective owner