# How to draw rectangle where the specific position?

**URL:** https://discourse.vtk.org/t/how-to-draw-rectangle-where-the-specific-position/4729
**Category:** Support
**Created:** [November 25, 2020, 2:31am UTC](https://discourse.vtk.org/t/how-to-draw-rectangle-where-the-specific-position/4729 "2020-11-25T02:31:18Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![nia38](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/n/7ba0ec/32.png) [@nia38](https://discourse.vtk.org/u/nia38)
#### Post date: [November 25, 2020, 2:31am UTC](https://discourse.vtk.org/t/how-to-draw-rectangle-where-the-specific-position/4729/1 "2020-11-25T02:31:18Z")

</div>

Hello,

I used VS2019 and vtk-8.9 version.

My plan is that:  
When the slide Bar(by using mfc component) is changing, drawing the rectangle on image viewer with slide bar’s value(the y-axis value).

So, I referred the Border Widget.  
However, I face problems.  
1) I don’t know setting an initial position and an rectangle’s size. Please recommend reference materials.  
2) And then, If image viewer is changing, the border widget is not changed. How can i solve it?

Please help me a lot.
