Image/ sketch in program
|
05-10-2023, 10:25 AM
(This post was last modified: 05-10-2023 10:28 AM by Amer7.)
Post: #1
|
|||
|
|||
Image/ sketch in program
Hi,
Is there a simple way to include a image/ sketch in program. Like before an input, or at the end so there is some kind of guidance when using a program? Like If i can use plot, is there a way I could draw it in some basic program like CAD, Paint etc. and than use some pogram to translate the image to a plotting code? Is there a way to plot 2D ( coodrinates x,y) -Points and than for it to show up? |
|||
05-10-2023, 03:36 PM
Post: #2
|
|||
|
|||
RE: Image/ sketch in program
Yeah, you can load a png to screen with G0:=AFiles("img.png") as long as that files exists in the application files, you can save it there before hand or put it there in the connection kit.
Of course you can also plot and draw on the calculator, you really should familiarise yourself with teh graphics section of the latest manual available at: https://literature.hpcalc.org/items/322 - around page 637 onwards. Quote:PIXON_P, PIXONthere are commands for lines, arcs, rectangles, triangles, and text to screen etc. G0 is the current graphic screen, G1 upwards are temporary graphics screens and you can copy between all of them with BLIT_P. Have a good read through the manual :-). |
|||
05-15-2023, 10:34 AM
(This post was last modified: 05-15-2023 06:12 PM by Amer7.)
Post: #3
|
|||
|
|||
RE: Image/ sketch in program
(05-10-2023 03:36 PM)matalog Wrote: Yeah, you can load a png to screen with G0:=AFiles("img.png") as long as that files exists in the application files, you can save it there before hand or put it there in the connection kit. Thank you for your reply, I will test it! EDIT: This works for me but in home screen G0:=AFiles("img.png") But when I make a program to calculate a few things, and then Print them out. EA: LOCAL xa,ya,xb,yb,xc,yc; xa:=4124.123; ya:=1234.12; xb:=2345.123; yb:=6678.123; xc:=8886.123; yc:=4444.444; y:=a1+b1; PRINT("y= "+y); G0:=AFiles("Y.png") - Where the Y.png is a picture of " y= a1+b1; to be shown after the print is done or before... ( I want to use the picture as a reference, like I have a program with 8 inputs, and few calculations, I want to have the sketch displayed so I could see what is input 1, input2....input 8....) I dont want to waste time going in gallery app and looking at the picture. And when I use pixon after Print like LOCAL y; y:=a1+b1; PRINT("y= "+y); PIXON(xa,ya); PIXON(xb,yb); PIXON(xc,yc); Only PRINT show up, no point drawing. |
|||
05-17-2023, 11:30 AM
(This post was last modified: 05-17-2023 11:32 AM by Amer7.)
Post: #4
|
|||
|
|||
RE: Image/ sketch in program
I have to use
RECT(); --- This clears the screen making it blank like a white a4 papper P_PIXON(x,y,color) ----- This draws the point WAIT(-1); ----- this makes the sceen wait untill i press anything. Now everything will be needed to be scaled down. Any ideas how to do it easy with number like 5-6 million, and make it self adapt ? Maybe while do? |
|||
05-17-2023, 07:27 PM
Post: #5
|
|||
|
|||
RE: Image/ sketch in program
I'm not sure what you are asking or saying really.
It will definitely help to read the section of the manual that I suggested. Another thing that the manual mentions is TEXTOUT_P() which will let you print text on top of the image, or just below it, so that the both things can be displayed at once. |
|||
05-17-2023, 07:28 PM
Post: #6
|
|||
|
|||
RE: Image/ sketch in program
(05-17-2023 11:30 AM)Amer7 Wrote: I have to use If you have a specific number of things you want to do just put them in some sort of loop. I would probably use a FOR NEXT loop if you know the number at the start. |
|||
05-18-2023, 05:21 PM
(This post was last modified: 05-18-2023 05:33 PM by Amer7.)
Post: #7
|
|||
|
|||
RE: Image/ sketch in program
(05-17-2023 07:27 PM)matalog Wrote: I'm not sure what you are asking or saying really. EXPORT tacka() BEGIN LOCAL xa,ya,xb,yb,xc,yc,red,green; red:=RGB(255,0,0); xa:=40.123; ---- POINT COORDINATES ya:=120.12; xb:=70.123; yb:=142.123; xc:=150.123; yc:=200.444; PRINT("yc="+yc); ----- PRINT OUT IN TERMINAL POINT COORDINATES PRINT("xc="+xc); WAIT(-1); ----- This will make terminal screen wait untill you press or move your finger on touch screen RECT() ----- This will make all of your screen white background PIXON_P(xb,yb,red); ----- This draws a point on the screen, in red color / PIXON_P(xc,yc,red); WAIT(-1); ----- It will stay on the display( point drawing untill you press anything ) END; Now whoever does geodesy he will know that most coordinates are six figures meaning y= 6 543 543,123m x=4 523 456,124m Hp prime cant draw this, it has reach of screen pixel size. Next would be to make a loop to autmatically divide the coordinates so they could fit the screen size. like while y/10>320 repeat etc. -My new question is. How can I make the pixel dimension thicker- Maybe draw a rectangle aroud it? Is there some way i could automatically draw a line between two points? The drawing in the end is a triangular network. Ie. triangle network with 4 points |
|||
05-18-2023, 10:10 PM
Post: #8
|
|||
|
|||
RE: Image/ sketch in program
I can only refer you to the manual I have been mentioning and the pages I already mentioned, they cover all of the drawing things you can use on the HP Prime.
Pages 640 and 641 tell you how to draw lines between 2 points, and also how to draw rectangles (even rectangles with lines of different colour around them. You can ues the LINE_P and RECT_P to do the things that you want. |
|||
05-24-2023, 08:03 PM
(This post was last modified: 05-24-2023 08:34 PM by Amer7.)
Post: #9
|
|||
|
|||
RE: Image/ sketch in program
(05-18-2023 10:10 PM)matalog Wrote: I can only refer you to the manual I have been mentioning and the pages I already mentioned, they cover all of the drawing things you can use on the HP Prime. Hey I managed to write the code. With the pixels, and while do loop. The issue is I'm facing This is x=10, and y=10; The HP prime has coordinate beginning in top left corner 0,0 Is it possible to make it to be coordinate beginning 0,0 from lower left corner? -I have to change the basis of coordinates- will try to find how Code: EXPORT tacka() |
|||
05-24-2023, 10:24 PM
Post: #10
|
|||
|
|||
RE: Image/ sketch in program
To flip the coordinate system upside down then make the Y coordinate 240-Y, that should start at the bottom Left, if You are putting text there, you may have to add the height of the text if the text position if at the top of the letters.
|
|||
05-25-2023, 11:18 AM
(This post was last modified: 05-25-2023 11:34 AM by Amer7.)
Post: #11
|
|||
|
|||
RE: Image/ sketch in program
Thank you, It works.
This is program for Pothenot snellius - Problem used in Geodesy to calculate the coordinates of point T. On the beginning you are asked to input coordinates of points A,M,B, and measured angle Alpha, Beta. Point A is determined going from unknown point T in clockwise direction A,M,B This is the result You can Use this data to test the program: Note: this is 47 deg- 43 min-13.8sec Calculator set in Degrees mode The code: Code:
@matalog I really appreciate the time you took to write the tips and commands. They were a lot of help! Also thank to other users like road that helped me in the past with the variable inputs. |
|||
05-25-2023, 12:37 PM
Post: #12
|
|||
|
|||
RE: Image/ sketch in program
That looks good, well done.
If you add a pixel or 2 to the coordinates of the lines source and destination x+1,y+1 for example, you will end up in the centre of a 2x2 pixel box or big dot. If might leave it looking a bit better. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)