/// <summary> /// ���̃T�[�t�F�C�X�̃f�[�^��������g�ɃR�s�[���� /// </summary> /// <param name="dstX">�R�s�[���X���W</param> /// <param name="dstY">�R�s�[���Y���W</param> /// <param name="src">�R�s�[���̃T�[�t�F�C�X</param> /// <param name="srcX">�R�s�[����X���W</param> /// <param name="srcY">�R�s�[����Y���W</param> /// <param name="w">����</param> /// <param name="h">�c��</param> public void copy(Int32 dstX, Int32 dstY, Surface src, Int32 srcX, Int32 srcY, Int32 w, Int32 h) { Byte[,] srcBuffer = src.getBuffer(); //�R�s�[�̈�̃N���b�s���O //�摜���]�����A�]����̗̈悩��͂ݏo���Ă��������������B Rectangle dstRect = getRect(), srcRect = src.getRect(); dstRect.Intersect(new Rectangle(dstX, dstY, w, h)); srcRect.Intersect(new Rectangle(srcX, srcY, w, h)); //���ۂɃR�s�[����̈�̕��E������w,h�ŗǂ��Ƃ͌���Ȃ��B //�R�s�[��A�R�s�[���̗̈�̕��̂����A���������̒l��g�p���� Int32 copyW = Math.Min(dstRect.Width, srcRect.Width), copyH = Math.Min(dstRect.Height, srcRect.Height); if(copyW < 1 || copyH < 1) { return; } Int32 ptDstX,ptDstY,ptSrcX,ptSrcY; for(Int32 y=0; y < copyH; y++) { for(Int32 x=0; x < copyW; x++) { ptDstX = dstRect.Left + x; ptDstY = dstRect.Top + y; ptSrcX = srcRect.Left + x; ptSrcY = srcRect.Top + y; _buffer[ptDstX,ptDstY] = srcBuffer[ptSrcX,ptSrcY]; } } }