# IKImageViewControlMBS question

**URL:** <https://forum.xojo.com/t/ikimageviewcontrolmbs-question/88791>\
**Category:** macOS\
**Created:** [August 23, 2026, 6:00pm UTC](https://forum.xojo.com/t/ikimageviewcontrolmbs-question/88791 "2026-08-23T18:00:42Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mark\_Sweeney](https://forum.xojo.com/user_avatar/forum.xojo.com/mark_sweeney/32/3332_2.png) [@Mark\_Sweeney](https://forum.xojo.com/u/Mark_Sweeney)\
**Post date:** [August 23, 2026, 6:00pm UTC](https://forum.xojo.com/t/ikimageviewcontrolmbs-question/88791/1 "2026-08-23T18:00:42Z")

</div>

I figured out how to use IKImageViewControlMBS.View.zoomFactor to change the scale/size of an image.

But I’m not having any luck figuring out how to move or drag the image around inside the IKImageViewControlMBS. Is there an example somewhere I’ve missed?

---

<div class="post-metadata">

**Author:** ![Christian\_Schmitz](https://forum.xojo.com/user_avatar/forum.xojo.com/christian_schmitz/32/158_2.png) [@Christian\_Schmitz](https://forum.xojo.com/u/Christian_Schmitz)\
**Post date:** [August 23, 2026, 6:23pm UTC](https://forum.xojo.com/t/ikimageviewcontrolmbs-question/88791/2 "2026-08-23T18:23:27Z")

</div>

well, you zoom in and then scroll to the area you like to show.

So you use scrollToRect method with a rectangle. And you may need convertImageRectToViewRect to calculate the rectangle.

---

<div class="post-metadata">

**Author:** ![Mark\_Sweeney](https://forum.xojo.com/user_avatar/forum.xojo.com/mark_sweeney/32/3332_2.png) [@Mark\_Sweeney](https://forum.xojo.com/u/Mark_Sweeney)\
**Post date:** [August 23, 2026, 7:08pm UTC](https://forum.xojo.com/t/ikimageviewcontrolmbs-question/88791/3 "2026-08-23T19:08:12Z")

</div>

I put this code into a button expecting it to move the zoomed image to the top left corner of the image. It doesn’t do anything. Image stays zoomed in and centered on the bottom left corner of the image.

```auto
Var k As IKImageViewControlMBS = IKImageViewControlMBS1
Var x, y, h, w As Integer

Var v As IKImageViewMBS = IKImageViewControlMBS1.View

w = v.Image.Width * v.zoomFactor
h = v.Image.Height * v.zoomFactor

Var r As NSRectMBS = New NSRectMBS(0,0, w , h)

r = v.convertImageRectToViewRect(r)
v.scrollToRect(r)

```

---

<div class="post-metadata">

**Author:** ![Christian\_Schmitz](https://forum.xojo.com/user_avatar/forum.xojo.com/christian_schmitz/32/158_2.png) [@Christian\_Schmitz](https://forum.xojo.com/u/Christian_Schmitz)\
**Post date:** [August 24, 2026, 6:54am UTC](https://forum.xojo.com/t/ikimageviewcontrolmbs-question/88791/4 "2026-08-24T06:54:44Z")

</div>

Let me try:

```auto
Var k As IKImageViewControlMBS = IKImageViewControlMBS1
Var v As IKImageViewMBS = IKImageViewControlMBS1.View
v.zoomFactor = 3

```

this zooms in to 3x.

Then

```auto
Var k As IKImageViewControlMBS = IKImageViewControlMBS1
Var v As IKImageViewMBS = IKImageViewControlMBS1.View

Var r As NSRectMBS = v.bounds
var imageVisibleRect as NSRectMBS = v.convertViewRectToImageRect(r)

MessageBox imageVisibleRect.String

```

gives “{{0, 0}, {200, 117.33333333333333}}” as the visible portion of the image.

But I think there is something broken in IKImageView with scrolling.

---

<div class="post-metadata">

**Author:** ![Christian\_Schmitz](https://forum.xojo.com/user_avatar/forum.xojo.com/christian_schmitz/32/158_2.png) [@Christian\_Schmitz](https://forum.xojo.com/u/Christian_Schmitz)\
**Post date:** [August 24, 2026, 10:53am UTC](https://forum.xojo.com/t/ikimageviewcontrolmbs-question/88791/5 "2026-08-24T10:53:18Z")

</div>

I tried to add a NSScrollview, but that didn’t work well.  
Maybe don’t zoom there. Use other controls for that.

---

<div class="post-metadata">

**Author:** ![Mark\_Sweeney](https://forum.xojo.com/user_avatar/forum.xojo.com/mark_sweeney/32/3332_2.png) [@Mark\_Sweeney](https://forum.xojo.com/u/Mark_Sweeney)\
**Post date:** [August 24, 2026, 4:42pm UTC](https://forum.xojo.com/t/ikimageviewcontrolmbs-question/88791/6 "2026-08-24T16:42:40Z")

</div>

I tried a couple of other things as well:

```auto
scrollToPoint(p)' nothing happens.

Var centerPoint As NSPointMBS
centerPoint = New NSPointMBS(0,0)
Var z As Double = v.zoomFactor
v.setImageZoomFactor(z, centerPoint)' it always zoomed to center, no matter what centerpoint is set to

```

Looks like I may have to abandon this project. Thanks for your suggestions.

---

<div class="post-metadata">

**Author:** ![Christian\_Schmitz](https://forum.xojo.com/user_avatar/forum.xojo.com/christian_schmitz/32/158_2.png) [@Christian\_Schmitz](https://forum.xojo.com/u/Christian_Schmitz)\
**Post date:** [August 24, 2026, 7:00pm UTC](https://forum.xojo.com/t/ikimageviewcontrolmbs-question/88791/7 "2026-08-24T19:00:43Z")

</div>

I am sorry for this mess. I tried a few more things, but I think something broke in Apple’s framework. I will deprecate the class.

---

<div class="post-metadata">

**Author:** ![Julia\_Truchsess](https://forum.xojo.com/user_avatar/forum.xojo.com/julia_truchsess/32/499_2.png) [@Julia\_Truchsess](https://forum.xojo.com/u/Julia_Truchsess)\
**Post date:** [August 25, 2026, 12:35pm UTC](https://forum.xojo.com/t/ikimageviewcontrolmbs-question/88791/8 "2026-08-25T12:35:17Z")

</div>

> [@Mark\_Sweeney](#):
>
> IKImageViewControlMBS

Maybe useful?  
[ZoomScrollCanvasJT.xojo\_binary\_code.zip](https://forum.xojo.com/uploads/short-url/wQK29JTluEt0lSnZWJxk0MrSy7G.zip) (5.9 KB)

---

<div class="post-metadata">

**Author:** ![Mark\_Sweeney](https://forum.xojo.com/user_avatar/forum.xojo.com/mark_sweeney/32/3332_2.png) [@Mark\_Sweeney](https://forum.xojo.com/u/Mark_Sweeney)\
**Post date:** [August 25, 2026, 1:45pm UTC](https://forum.xojo.com/t/ikimageviewcontrolmbs-question/88791/9 "2026-08-25T13:45:16Z")

</div>

I may be missing something, but it looks like it uses Picture, which changes the display color to a generic RBG color profile instead of using the sRGB color profile in the image.

---

<div class="post-metadata">

**Author:** ![Julia\_Truchsess](https://forum.xojo.com/user_avatar/forum.xojo.com/julia_truchsess/32/499_2.png) [@Julia\_Truchsess](https://forum.xojo.com/u/Julia_Truchsess)\
**Post date:** [August 25, 2026, 2:03pm UTC](https://forum.xojo.com/t/ikimageviewcontrolmbs-question/88791/10 "2026-08-25T14:03:07Z")

</div>

Yeah, I don’t know what IKImageViewControlMBS does, but on the off chance you just needed a canvas that can be zoomed and panned with the mouse/scrollwheel/trackpad, I happened to have that 🙂
