How to get docking node's size?

i’m trying to draw an image fill the center docking node:

if (ImGui::DockBuilderGetNode(ImGui::GetID("MyDockspace")) == NULL)
	ImGuiID dockspace_id = ImGui::GetID("MyDockspace");
	ImGui::DockBuilderRemoveNode(dockspace_id); // Clear out existing layout
	ImGui::DockBuilderAddNode(dockspace_id, 0); // Add empty node
	ImGui::DockBuilderSetNodeSize(dockspace_id, viewport->Size);

	ImGuiID dock_main_id = dockspace_id; // This variable will track the document node, however we are not using it here as we aren't docking anything into it.
	ImGuiID dock_id_left = ImGui::DockBuilderSplitNode(dock_main_id, ImGuiDir_Left, 0.20f, NULL, &dock_main_id);
	ImGuiID dock_id_right = ImGui::DockBuilderSplitNode(dock_main_id, ImGuiDir_Right, 0.20f, NULL, &dock_main_id);
	ImGuiID dock_id_bottom = ImGui::DockBuilderSplitNode(dock_main_id, ImGuiDir_Down, 0.20f, NULL, &dock_main_id);

	ImGui::DockBuilderDockWindow("James_1", dock_id_left);
	ImGui::DockBuilderDockWindow("James_2", dock_main_id);
	ImGui::DockBuilderDockWindow("James_3", dock_id_right);
	ImGui::DockBuilderDockWindow("James_4", dock_id_bottom);

ImGui::PushStyleColor(ImGuiCol_DockingEmptyBg, ImVec4(1, 1, 1, 1));
ImGuiID dockspace_id = ImGui::GetID("MyDockspace");
ImGui::DockSpace(dockspace_id, ImVec2(0.0f, 0.0f), 0);

ImGui::Begin("James_1", &open, 0);
ImGui::Text("Text 1");

ImGui::Begin("James_2", &open, 0);
auto dock_main_id = ImGui::GetID("MyDockspace");
auto dock_main = ImGui::DockBuilderGetCentralNode(dock_main_id);
ImGuiIntegration::image(_renderTexture, {dock_main->Size.x, dock_main->Size.y});

ImGui::Begin("James_3", &open, 0);
ImGui::Text("Text 3");

ImGui::Begin("James_4", &open, 0);
ImGui::Text("Text 4");

the dock_main here is nullptr. any suggestion? TIA!

You didn’t create a dockspace node so it has no central node.
Comment says:
- You can create dockspace _or_ floating nodes with this API. To create a dockspace node, make sure to set the ImGuiDockNodeFlags_DockSpace flag.