Maybe there are DirectX-functions to work with pixels of a target map.