copying unsigned char array?
Posted: Sat Mar 17, 2007 9:00 am
Hey all. I'm trying to play around with wxImage alpha channel data and I seem to be a little stumped with how to handle unsigned char* 's properly.
Basically, wxImage::GetAlpha() returns a pointer to an unsigned char* array so I can directly manipulate the alpha channel. Before doing this though, I'd like to copy the array so I have an unmodified version that I can put back when I'm done.
So my question is, how can I copy an unsigned char* array? memcpy()? (which doesn't work). I'd also like to know how to get the length because strnlen() doesn't work either.
Anyone?
Basically, wxImage::GetAlpha() returns a pointer to an unsigned char* array so I can directly manipulate the alpha channel. Before doing this though, I'd like to copy the array so I have an unmodified version that I can put back when I'm done.
So my question is, how can I copy an unsigned char* array? memcpy()? (which doesn't work). I'd also like to know how to get the length because strnlen() doesn't work either.
Anyone?