RF Studio 版权所有
using System;
using XXXXXXXXXXXXXXXXXXXXXneric;
using XXXXXXXXXXponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using XXXXXXXXXXXXsualBasic;
namespace Binary
{
public class CSunsafe
{
private XXXXXXXXXXXXXXXXXtmap curBitmap;
private int[,] pic;
private int[,,] pic1;
public void File_Init(string sFilename)
{
if (sFilename != null)
{
curBitmap = (Bitmap)XXXXXXXXomFile(sFilename);
}
}
public void BMP_Init(Bitmap BMP)
{
if (BMP != null)
{
curBitmap = BMP;
}
}
public int[,,] GetRGB()
{
if (curBitmap != null)
{
Rectangle rect = new Rectangle(0, 0, curBitmap.Width, curBitmap.Height);
XXXXXXXXXXXXXXXXXXXXXXXXXtmapData bmpData = curBitmap.LockBits(rect, XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXadWrite, curBitmap.PixelFormat);
pic = new int[bmpData.Width, bmpData.Height];
pic1 = new int[3,bmpData.Width+1, bmpData.Height+1];
unsafe
{
byte* ptr = (byte*)(XXXXXXXXXXan0);
for (int i = 0; i < bmpData.Height; i++)
{
for (int j = 0; j < bmpData.Width; j++)
{
pic1[0,j,i]=ptr[2];
pic1[1,j,i]=ptr[1];
pic1[2, j, i] = ptr[0];
ptr += 3;
}
ptr += XXXXXXXXXXride - bmpData.Width * 3;
}
}
curBitmap.UnlockBits(bmpData);
return pic1;
}
else
{
return null;
}
}
}
}
200字以内,仅用于支线交流,主线讨论请采用回复功能。