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