DIMGROB back from Graphics Variable?
05-24-2021, 09:24 PM
Post: #1
 matalog Member Posts: 211 Joined: May 2021
DIMGROB back from Graphics Variable?
Is there a way to get a DIMGROB from a G1 Graphic Variable, so that I can include it in a program, instead of having to transport the .png file from which the G1 is created with the program, for another person to try out?

So if G1 is defined on a HP Prime, is there a way to get a DIMGROB from the calc?
05-26-2021, 10:07 PM (This post was last modified: 05-26-2021 10:32 PM by matalog.)
Post: #2
 matalog Member Posts: 211 Joined: May 2021
RE: DIMGROB back from Graphics Variable?
I found a way to do it, but it will obviously require a large amount of space in the program, it works though, and can be used to put sprites into a program and not need to send any files along with the program.

Code:
EXPORT NH() BEGIN DIMGROB_P(G1,26,26); LOCAL CXL:="DIMGROB(G1,26,26,{";  G1:=AFiles("b3l.png");   FOR Y FROM 0 TO 25 DO     FOR X FROM 0 TO 25 DO   CXL:=CXL+GETPIX_P(G1,X,Y)+", ";     END;   END; CXL:=CXL+"});"; Notes("COL"):=CXL; END;

This saves the colours of the 'sprite' or graphic which can be loaded as a PNG, to a notes file called COL, which can be viewed on computer, and then pasted as a DIMGROB, and therefore entered into a program.
 « Next Oldest | Next Newest »

User(s) browsing this thread: 1 Guest(s)