Get UImage position relative to the viewport

Hi I am trying to get a position of the UImage relative to the viewport using C++.

The image is around the middle of the screen, If the UImage or UCanvasPanelSlot is wrapped with other Canvas types, the position will be local and not relative to the whole viewport. (Unless I am doing something else wrong)

	UCanvasPanelSlot* canvasSlot = UWidgetLayoutLibrary::SlotAsCanvasSlot(canvasImage);
	FVector2D imagePosOnScreen = canvasSlot->GetPosition();

Result is 0;0, same as show on in the Designer. I want, and expect to get a position in the viewport.

Thank you.

Hi Roadified, very good question! You should use:

	FGeometry geo = canvasUImage->GetPaintSpaceGeometry();
	FVector2D paintPos = geo.GetAbsolutePosition();