# LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

## Re: Draw picture slow down

For some perspective on the original problem, have a look at my post in an interesting old thread from a over decade ago. 😄

Message 21 of 25
(1,101 Views)

## Re: Draw picture slow down

The problem with a 2D array is that it's much harder to draw circles, lines and boxes (with varying line widths) in it.

Looking at the OP, the 'static' picture has lines, boxes and circles.

Of course you can draw the static stuff up front, convert it to a pixmap, and draw over the pixmap...

Message 22 of 25
(1,086 Views)

## Re: Draw picture slow down

Well, in my example, each point of the intensity graph is exactly 1x1 pixels of the monitor (might need slight adjustments, but I am close). For example of you want a specific sprite, you could compose it as e.g. 50x50 picture, convert to a 2D array, then convert all pixels to be drawn to a 1D complex array and use the same code as to what I did for the crosshair in the last example). The nice things with complex is that you can even apply a rotation if needed, for example to model a spaceship traveling along an arbitrary curve.

Message 23 of 25
(1,070 Views)
Solution
Accepted by topic author Walker34

## Re: Draw picture slow down

@altenbach wrote:

The nice things with complex is that you can even apply a rotation if needed...

Here's a simple example that rotates and pulsates the crosshair. 😄

(I reduced the canvas to 400x400 for simplicity. With a 0ms wait (not recommended) Loop rate is a constant 14us, independent on the number of points. This means that even with a 1ms wait, the loop is 98+% idle. :D)

It would be easy to make all elements e.g. double-width or triple-width, of course)

Message 24 of 25
(1,058 Views)

## Re: Draw picture slow down

Sorry I was sick last days, I didn't answered. Thank you for your detailed answer altenbach. It seems to be a good solution. Drawing pixel after pixel is not friendly, but it is allway possible to generate sprites with normal picture functions or another drawing software.

This intensity graph is suprisely smooth with a very high refresh rate. Definitively a good way to draw animated pictures.