Big thanks rain_storm I will try to this out.
First I allocate memory for texture and load it
LPDIRECT3DTEXTURE9 sprite; // the pointer to the sprite
D3DXCreateTextureFromFileEx(d3ddev, // the device pointer
L"Panel2.png", // file name to load texture from
D3DX_DEFAULT, // default width
D3DX_DEFAULT, // default height
D3DX_DEFAULT, // no mip mapping
NULL, // regular usage
D3DFMT_A8R8G8B8, // 32-bit pixels with alpha
D3DPOOL_MANAGED, // typical memory handling
D3DX_DEFAULT, // no filtering
D3DX_DEFAULT, // no mip filtering
D3DCOLOR_XRGB(255, 0, 255), // the hot-pink color key
NULL, // no image info struct
NULL, // not using 256 colors
&sprite); // load to sprite
2. Im not sure if Im doing this next step right
RECT area;
D3DLOCKED_RECT area2;
SetRect(&area, 10, 10, 30, 30); // I define area to be 20 x 20 big area from sprite
sprite->LockRect(0, &area2, &area, D3DLOCK_DISCARD); // and then I lock it
How can I access that area
can i now use sprite as a pointer and plot thing to it like
for (int i = 0; i < 30 * 30; i++)
{
&sprite[i] = D3DCOLOR_XRGB(255, 0, 255); // this dosent work
}