   IDirect3DTexture9::LockRect()
  I''m writing a function in my sprite class to be able to get pixel data from a given point (x,y) do so simple collition detection. Here''s the rutine:D3DCOLOR MBGSprite::GetPixel(int x, int y){ D3DLOCKED_RECT LockedRect; m_pSrcTexture->LockRect(0, &LockedRect, NULL, D3DLOCK_READONLY); LockedRect.Pitch /=4; DWORD* pData=(DWORD*)(LockedRect.pBits); D3DCOLOR temp = pData[y*LockedRect.Pitch + x]; m_pSrcTexture->UnlockRect(0); return temp;}pData[y*LockedRect.Pitch + x] causes an access violation. When i output the size of pitch, its is 0 and pData = 4. Does this mean the texture is not extracted properly? 
  What parameters (esp. pool) did you use to create your texture? ;  D3DXCreateTextureFromFileEx(m_pDevice,PathName,m_info.Width,m_info.Height,m_info.MipLevels,0,m_info.Format ,D3DPOOL_DEFAULT,D3DX_DEFAULT,D3DX_DEFAULT,m_modulateColor,NULL,NULL,&m_pSrcTexture); ;Try creating the texture using D3DUSAGE_DYNAMIC. 