/// <summary> /// 根据sg所描述的位置、大小和倍率, 读取一个区域 /// </summary> /// <param name="sg"></param> /// <returns></returns> public byte[] LoadRegionBMP(SceneGeometry sg) { Helper.InitBgraHeader(imgBmpBuf, (int)sg.OutW, (int)sg.OutH); slide.DangerousReadRegion(sg.L, (int)sg.X, (int)sg.Y, (int)sg.OutW, (int)sg.OutH, ref imgBmpBuf[Helper.BMP_BGRA_DATA_OFFSET]); return(imgBmpBuf); }
/// <summary> /// 根据sg所描述的位置、大小和倍率, 读取一个区域 /// </summary> /// <param name="view"></param> /// <returns></returns> public byte[] LoadRegionBMP(Viewport view) { Helper.InitBgraHeader(imgBmpBuf, (int)view.OutW, (int)view.OutH); img.DangerousReadRegion(view.L, (int)view.X, (int)view.Y, (int)view.OutW, (int)view.OutH, ref imgBmpBuf[Helper.BMP_BGRA_DATA_OFFSET]); return(imgBmpBuf); }