07-22-2010 06:37 AM
Hi ...
I have a question about 3D Arrays, specially 3D Boolean Arrays.
Is it possible that "page" part of a 3D Boolean Array ( the first dimension ) has different size ? (diffrenet row and column)
It seems that the answer is no ! , so what do should i do ? see the pictures ...
This is for a Jet Printer (Dot Matrix) project.
07-22-2010 07:08 AM
You are correct that the answer is no. Any multidimensional array must have the same number of columns in each row and the same number of rows and columns in each page with similar extensions to higher dimensions.
You may want to make a 1D array of clusters where each cluster contains a 2D array of booleans. The arrays in each cluster can be of different sizes as long as they are all of the same type. What you are now trying to do with page indexes in the 3D array now becomes the index of the cluster array.
You could also use a queue of 2D arrays of booleans. Each element of the queue must be a 2D array but can be a different size from other elements.
Lynn
07-23-2010 07:29 AM
Thank you so much. My problem has been solved.
I have another question. In a part of my project I have an 2D Boolean Array as you can see in follow. How can I insert 2D Boolean Array data to a wish indeces of my main 2D Boolean Array ? (NOT from the first of Array. for example from coordinates of 4,8 )
Look at the picture . Please help.
Tnx again
07-23-2010 07:54 AM - edited 07-23-2010 07:54 AM
First initialize an array with all false elements to the size of the final array. Then use Replace Array Subset to put the input array where you want it.
Lynn
10-20-2010 02:19 AM
Hi all ...
I need simple "Graphic Editor" program. This is a part of my project. Main element is an 2D Boolean Array which is a control. User must capable to draw simple shapes such as a rectangle. Does anybody have an idea ?
for example to draw a rectangle first click on primary corner on 2D array then click on last corner and program draw a rectangle on 2D array. And another shapes such as simple line and circle (if possible)
I've a program which in while loop after registering for 2D Booolean Array Mouse Down Event and giving Coordinates and Control Refnum to it, so it gives clicked coordinates on 2D array.
10-20-2010 07:44 AM
Have a look at the following links:
http://forums.ni.com/t5/LabVIEW/How-2D-Value-Array-to-Bitmap-Image-in-LabView/m-p/195393#M112461
http://forums.ni.com/t5/LabVIEW/Labview-7-0-how-to-draw-quickly-300-000-points/m-p/115959#M69987
Have a look at the etch a sketch example, too: http://decibel.ni.com/content/docs/DOC-13593
Now, these are all more complicated drawing than what you are looking for.
I do recall that there was an example of a simple draw pad (maybe in one of the basics course). I didn't find it yet on the forum.
10-20-2010 07:50 AM
Found more:
http://forums.ni.com/t5/LabVIEW/can-labview-draw-like-a-pen-or-pencil/m-p/1241954
(there's an older etch a sketch example)
really fancy stuff (3D): http://zone.ni.com/devzone/cda/tut/p/id/3170
might be interesting:
http://forums.ni.com/t5/LabVIEW/change-line-thickness-in-draw-line/m-p/159176
10-20-2010 10:06 AM - edited 10-20-2010 10:07 AM
Thank you very much
But these are not my desired program. None of it !
I need a program which operate on 2D boolean array directly as simple as possible (user friend!). using above method which I told before.
F1 ----->> Help !!!!
10-20-2010 08:27 PM
Mostafi,
Unfortunately there are no turn key solutions available in a dev zone or community example but the other members posting to this forum have sent you in a good direction.
10-21-2010 11:42 AM
Thanks
Ok
I have wrote a simple program to draw line and rectangles but not automatically. Have a look. Click on a LED and drag mouse. It follows mouse movement and toggle LED status.
Does anybody can improve it ?