# Drawing something (a line) on top of an OpenGlSurface image

**URL:** <https://forum.xojo.com/t/drawing-something-a-line-on-top-of-an-openglsurface-image/68654>\
**Category:** General\
**Created:** [February 20, 2022, 5:14pm UTC](https://forum.xojo.com/t/drawing-something-a-line-on-top-of-an-openglsurface-image/68654 "2022-02-20T17:14:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ramon\_SASTRE](https://forum.xojo.com/user_avatar/forum.xojo.com/ramon_sastre/32/326_2.png) [@Ramon\_SASTRE](https://forum.xojo.com/u/Ramon_SASTRE)\
**Post date:** [February 20, 2022, 5:14pm UTC](https://forum.xojo.com/t/drawing-something-a-line-on-top-of-an-openglsurface-image/68654/1 "2022-02-20T17:14:03Z")

</div>

I am using the OpenGlSurface control. At certain moment I have a complex image (it took some time to render) and I’d like to draw something (imagine a line) on top of the current image.

If I have to render everything plus the new line again it will take too much time.

Is it a way of drawing something on top of the image?

I though about using the current image as a background and draw on top of it.

But perhaps there is something much simpler to do.

Any help will be welcome

---

<div class="post-metadata">

**Author:** ![MarkusR](https://forum.xojo.com/user_avatar/forum.xojo.com/markusr/32/685_2.png) [@MarkusR](https://forum.xojo.com/u/MarkusR)\
**Post date:** [February 20, 2022, 9:08pm UTC](https://forum.xojo.com/t/drawing-something-a-line-on-top-of-an-openglsurface-image/68654/2 "2022-02-20T21:08:23Z")

</div>

i think because it use double buffer every call to Render  
will paint into something new and then this buffer get visible.

can you use `Me.MouseCursor = System.Cursors.Wait` ?

---

<div class="post-metadata">

**Author:** ![Ramon\_SASTRE](https://forum.xojo.com/user_avatar/forum.xojo.com/ramon_sastre/32/326_2.png) [@Ramon\_SASTRE](https://forum.xojo.com/u/Ramon_SASTRE)\
**Post date:** [February 21, 2022, 8:09am UTC](https://forum.xojo.com/t/drawing-something-a-line-on-top-of-an-openglsurface-image/68654/3 "2022-02-21T08:09:50Z")

</div>

Markus,  
Thank you very much for your reply…  
Yes the cursor works normally over an image on a OpenGLSurface and I’ve made same tests capturing this image in a picture, but I find weird not being able to draw easily something on top of what is displayed. That’s why I have asked the forum.

---

<div class="post-metadata">

**Author:** ![MarkusR](https://forum.xojo.com/user_avatar/forum.xojo.com/markusr/32/685_2.png) [@MarkusR](https://forum.xojo.com/u/MarkusR)\
**Post date:** [February 21, 2022, 11:30am UTC](https://forum.xojo.com/t/drawing-something-a-line-on-top-of-an-openglsurface-image/68654/4 "2022-02-21T11:30:24Z")

</div>

have you tried what happens if you call render and draw only a 3d line?

---

<div class="post-metadata">

**Author:** ![Sam\_Rowlands](https://forum.xojo.com/user_avatar/forum.xojo.com/sam_rowlands/32/265_2.png) [@Sam\_Rowlands](https://forum.xojo.com/u/Sam_Rowlands)\
**Post date:** [February 22, 2022, 12:30am UTC](https://forum.xojo.com/t/drawing-something-a-line-on-top-of-an-openglsurface-image/68654/5 "2022-02-22T00:30:21Z")

</div>

On the macOS, you can force layer-backed views, then place a canvas over the top of the OpenGLView and draw what-ever the fudge you want.

It’s how I draw guides in HDRtist NX.
