# Get the size of UCanvasPanel C++

**URL:** <https://forums.unrealengine.com/t/get-the-size-of-ucanvaspanel-c/465433>\
**Category:** Rendering\
**Tags:** size, canvas, get, unreal-engine, question\
**Created:** [May 19, 2020, 3:27am UTC](https://forums.unrealengine.com/t/get-the-size-of-ucanvaspanel-c/465433 "2020-05-19T03:27:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![danielf94](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@danielf94](https://forums.unrealengine.com/u/danielf94)\
**Post date:** [May 19, 2020, 3:27am UTC](https://forums.unrealengine.com/t/get-the-size-of-ucanvaspanel-c/465433/1 "2020-05-19T03:27:13Z")

</div>

Hello, I need to get the size of UCanvasPanel c++

```
.h
    
UPROPERTY(meta = (BindWidget))
class UCanvasPanel* MyCanvas;

```

I need to get inside a Vector2D X and Y the size of my panel, the panel is created from the designer but I call it using BindWidget.

---

<div class="post-metadata">

**Author:** ![Noowai](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Noowai](https://forums.unrealengine.com/u/Noowai)\
**Post date:** [May 19, 2020, 6:10pm UTC](https://forums.unrealengine.com/t/get-the-size-of-ucanvaspanel-c/465433/2 "2020-05-19T18:10:23Z")

</div>

There’s **FVector2D UWidget::GetDesiredSize()** method, but I’ve never used it myself, in code, plus, if you need to get some coordinates inside of your Canvas panel, you’ll have to keep in mind DPI scale of your viewport.  
I recently moved all of my widgets to blueprints because of many troubles in handling them inside code. But fortunately in my project it was possible.

---

<div class="post-metadata">

**Author:** ![danielf94](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@danielf94](https://forums.unrealengine.com/u/danielf94)\
**Post date:** [May 21, 2020, 11:40am UTC](https://forums.unrealengine.com/t/get-the-size-of-ucanvaspanel-c/465433/3 "2020-05-21T11:40:15Z")

</div>

thanks I was able to solve it. but the value returns 0, so I had to add another panel inside that one with the same dimensions and if it works.
