HP Forums

Full Version: Picture and Input
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How can I created a Picture with an Input-Funktion?

EXPORT kor()
BEGIN

Local x;
RECT_P();
//Linie und Pfeil in x-Richtung
LINE_P(40,59,79,59,RGB(0,255,0));
LINE_P(40,60,80,60,RGB(0,255,0));
LINE_P(40,61,79,61,RGB(0,255,0));
LINE_P(80,60,73,57,RGB(0,255,0));
LINE_P(80,60,73,63,RGB(0,255,0));
Textout_P("X",85,55,2);

//Linie und Pfeil in y-Ricjhtung
LINE_P(39,60,39,21,RGB(255,0,0));
LINE_P(40,60,40,20,RGB(255,0,0));
LINE_P(41,60,41,21,RGB(255,0,0));
LINE_P(40,20,37,26,RGB(255,0,0));
LINE_P(40,20,43,26,RGB(255,0,0));
Textout_P("Y",37,5,2);

//Linie und Pfeil in z-Richtung
LINE_P(39,60,20,79,RGB(0,0,255));
LINE_P(40,60,20,80,RGB(0,0,255));
LINE_P(41,60,21,80,RGB(0,0,255));
LINE_P(20,80,22,73,RGB(0,0,255));
LINE_P(20,80,27,77,RGB(0,0,255));
Textout_P("Z",10,85,2);
FREEZE;
END;
[/b]
There are several ways. Here is one way using reserved variables M1 and X. (Your input is through the editmat(M1) function):

Code:

EXPORT kor()
BEGIN

EDITMAT(M1);  // You can expand the matrix M1, or use separate matrices for "Y" and "Z"
RECT_P();

//Linie und Pfeil in x-Richtung
FOR X FROM 1 TO rowDim(M1) DO
  LINE_P(M1(X,1),M1(X,2),M1(X,3),M1(X,4),RGB(0,255,0));
END;

//LINE_P(40,59,79,59,RGB(0,255,0));
//LINE_P(40,60,80,60,RGB(0,255,0));
//LINE_P(40,61,79,61,RGB(0,255,0));
//LINE_P(80,60,73,57,RGB(0,255,0));
//LINE_P(80,60,73,63,RGB(0,255,0));

Textout_P("X",85,55,2);

//Linie und Pfeil in y-Ricjhtung
LINE_P(39,60,39,21,RGB(255,0,0));
LINE_P(40,60,40,20,RGB(255,0,0));
LINE_P(41,60,41,21,RGB(255,0,0));
LINE_P(40,20,37,26,RGB(255,0,0));
LINE_P(40,20,43,26,RGB(255,0,0));
Textout_P("Y",37,5,2);

//Linie und Pfeil in z-Richtung
LINE_P(39,60,20,79,RGB(0,0,255));
LINE_P(40,60,20,80,RGB(0,0,255));
LINE_P(41,60,21,80,RGB(0,0,255));
LINE_P(20,80,22,73,RGB(0,0,255));
LINE_P(20,80,27,77,RGB(0,0,255));
Textout_P("Z",10,85,2);
FREEZE;
END;
Hello DrD,
thanks for your answer.
That is not what i mean.

i mean this on (look Picture).
I see what you're after, and I don't know how to do that. It may be possible to save the graphic object in a variable, and use that as a label for the input statement. I haven't tried that...
(06-06-2015 12:39 PM)DrD Wrote: [ -> ]I see what you're after, and I don't know how to do that. It may be possible to save the graphic object in a variable, and use that as a label for the input statement. I haven't tried that...

sorry for OT, but in another post I wrote about labels in input, wondering how to get them without use a text field.
I wasn't able to get such a label, however.
Do you know how is it syntax, please?

Thank you,
Salvo
The essence of it would be to use the GETPIX_P() to save the contents of your graphic rectangle (in a list or matrix), and then use PIXON_P() to replicate it on the graphic screen. You would PIXON the image just prior to the INPUT. A foreseeable problem is that I don't know what graphics screen the input command uses, but I think I inadvertently did just that very thing, when I was working with my Smith Chart program several months ago. In that case, it was an unintended effect. I didn't want to have the overlay graphic on the input screen! I don't remember the how's and why's, but if it happens again, I'll make note of it.

I don't think the Prime is able to do that normally, it was several rev's ago, and may have been a bug that just happened to have that result. It would be a nice feature, though, especially considering the geographical value.
Reference URL's