A
allanon76
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.Format64bppArgb);
BitmapData bmd = myBitmap.LockBits(new
Rectangle(0,0,256,256),ImageLockMode.ReadWrite,PixelFormat.Format64bppArgb);
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)grayvalue;
}
}
}
myBitmap.UnlockBits(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.Format64bppArgb);
BitmapData bmd = myBitmap.LockBits(new
Rectangle(0,0,256,256),ImageLockMode.ReadWrite,PixelFormat.Format64bppArgb);
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)grayvalue;
}
}
}
myBitmap.UnlockBits(bmd);
thank you all.
michele