LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Draw picture slow down

Solved!
Go to solution

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

0 Kudos
Message 21 of 25
(1,028 Views)

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...

0 Kudos
Message 22 of 25
(1,013 Views)

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.

0 Kudos
Message 23 of 25
(997 Views)
Solution
Accepted by Walker34

@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)

 

altenbach_0-1639682763412.png

 

Message 24 of 25
(985 Views)

 

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.

 

Thank you for your support.

 

 

0 Kudos
Message 25 of 25
(950 Views)