I think this must be an easy question for somebody who uses bitmap in C++. I have my a working code in C# - how to do something simillar in C++ ?? Thanks for your codes (help) :-))
public Bitmap Visualize ()
{
PixelFormat fmt = System.Drawing.Imaging.PixelFormat.Format24bppRgb;
Bitmap result = new Bitmap( Width, Height, fmt );
BitmapData data = result.LockBits( new Rectangle( 0, 0, Width, Height ), ImageLockMode.ReadOnly, fmt );
unsafe
{
byte* ptr;
for ( int y = 0; y < Height; y++ )
{
ptr = (byte*)data.Scan0 + y * data.Stride;
for ( int x = 0; x < Width; x++ )
{
float num = 0.44;
byte c = (byte)(255.0f * num);
ptr[0] = ptr[1] = ptr[2] = c;
ptr += 3;
}
}
}
result.UnlockBits( data );
return result;
}