为什么用Bitmap类生成的图片不能被C++程序 或PS识别?
public Bitmap SetResolution(Bitmap bitmap)
{
if ((bitmap.Height < 512) && (bitmap.Width < 1024))
{
return bitmap;
}
Rectangle rec = new Rectangle(0, 0, bitmap.Width, bitmap.Height);
BitmapData bmpData = bitmap.LockBits(rec, ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
IntPtr Scan0 = bmpData.Scan0;
int stride = bmpData.Stride;
int nWidth = bmpData.Width;
int nHeight = bmpData.Height;
int size = bitmap.Width / 512 - 1;
int width = nWidth / size;
int height = nHeight / size;
Bitmap z_Bitmap = new Bitmap(width, height);
Rectangle rec2 = new Rectangle(0, 0, z_Bitmap.Width, z_Bitmap.Height);
BitmapData bmpData2 = z_Bitmap.LockBits(rec2, ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
IntPtr Scan02 = bmpData2.Scan0;
int nWidth2 = bmpData2.Width;
int nHeight2 = bmpData2.Height;
unsafe
{
byte* p = (byte*)(void*)Scan0;