I need to create an Image with more then 256 gray scale.
this is my code, i've some problem setting correctly the pixel value.
any idea?
There is another way to create an image with more then 256 gray
Bitmap myBitmap = new
Bitmap(256,256, PixelFormat.For mat64bppArgb);
BitmapData bmd = myBitmap.LockBi ts(new
Rectangle(0,0,2 56,256),ImageLo ckMode.ReadWrit e,PixelFormat.F ormat64bppArgb) ;
unsafe
{
int PixelSize=8;
for(int y=0; y<bmd.Height; y++)
{
byte* row=(byte *)bmd.Scan0+(y* bmd.Stride);
for(int x=0; x<bmd.Width; x++)
{
row[x*PixelSize]=(byte)grayvalu e;
}
}
}
myBitmap.Unlock Bits(bmd);
thank you all.
michele
this is my code, i've some problem setting correctly the pixel value.
any idea?
There is another way to create an image with more then 256 gray
Bitmap myBitmap = new
Bitmap(256,256, PixelFormat.For mat64bppArgb);
BitmapData bmd = myBitmap.LockBi ts(new
Rectangle(0,0,2 56,256),ImageLo ckMode.ReadWrit e,PixelFormat.F ormat64bppArgb) ;
unsafe
{
int PixelSize=8;
for(int y=0; y<bmd.Height; y++)
{
byte* row=(byte *)bmd.Scan0+(y* bmd.Stride);
for(int x=0; x<bmd.Width; x++)
{
row[x*PixelSize]=(byte)grayvalu e;
}
}
}
myBitmap.Unlock Bits(bmd);
thank you all.
michele
Comment