I hope you reconsider you usage of Imgui, you are looking for this:
//gamma correction
m_Device->SetRenderState(D3DRS_SRGBWRITEENABLE, 0);
//fix for drawing d3d9 if ingame cl_showfps is off!!
m_Device->SetRenderState(D3DRS_COLORWRITEENABLE, 0xFFFFFFFF); //D3DCOLORWRITEENABLE_RED | D3DCOLORWRITEENABLE_GREEN | D3DCOLORWRITEENABLE_BLUE | D3DCOLORWRITEENABLE_ALPHA