Post Reply 
A query on Graphics Syntax
05-13-2016, 05:15 PM (This post was last modified: 05-13-2016 05:34 PM by StephenG1CMZ.)
Post: #1
A query on Graphics Syntax
A couple of questions on Graphics Syntax...

Is it possible to use something more generic than G7 in a graphics command - GN, in case the user is using G7?

Is it possible to use AFiles instead of G7 - they both represent graphics objects?

Code:


 LOCAL GN;
 EXPORT TRYA()
 //EXAMPLE ASSUMES REFERENCED FILE
 //IS AN EXISTING PNG
 BEGIN 
  //I WANT TO REFERENCE GN INSTEAD OF CODING IN A SPECIFIC Gn
  //TO MAKE CODE MORE FLEXIBLE
  GN:='G6';
  DIMGROB(GN,320,240);//NO COMPLAINTS
  GN:=AFiles("BSL_A");
  //BLIT_P(G0,GN);//RUNTIME ERR HERE IF UNCOMMENTED
  WAIT;
  //CAN I AVOID USING Gn
  //AND USE AFiles DIRECTLY?
  //IT RETURNS A GRAPHIC OBJECT DOESNT IT?
  //NO IT DOESNT
  MSGBOX(AFiles);//CONFIRM FILE EXISTS
  BLIT_P(G0,AFiles("BSL_A"));//NO ITS A RUNTIME ERROR
  WAIT;
  
  FREEZE;
 END;

The code so far suggests not - but perhaps the experts have a solution.

Also, in the on-calculator help (Android version) there is a reference to DIMGROB/GROB size (320,1240)... I assume that is a misprint for 240, not an upgrade to a HD resolution. Sad

Stephen Lewkowicz (G1CMZ)
Visit this user's website Find all posts by this user
Quote this message in a reply
05-13-2016, 11:11 PM
Post: #2
RE: A query on Graphics Syntax
No es posible crear variables gráficas. Sí es posible crear gráficos Nombrados con ICON.

Los G0-9 siempre son operados como expresiones, por lo que al hacer:
GN:=G7 o GN:='G7' es lo mismo. Ambos hacen referencia a la variable gráfica G7.

Al hacer:
DIMGROB(GN,320,240); se esta configurando G7
También falta señalar que se haga por pixel -> DIMGROB_P

Esta expresión redefine tamaño y contenido.
GN:=AFiles("BSL_A"); Por lo que no era necesario dimensionar GN (G7) anteriormente.

En tu código creado se puede obtener el gráfico en pantalla con GN o G7.
BLIT(G0,GN) = BLIT(GN) = BLIT(G7)

Esto es un error
BLIT_P(G0,AFiles("BSL_A"));
BLIT necesita como parámetros una referencia a variables gráficas o una fuente, como:
G0: Pantalla
G7: Varible gráfica temporal
Ocurrirá error si se intenta pasar AFiles("BSL_A") ya que no es una referencia, estos son datos puros, al cual BLIT no esta preparado para recibirlo.

Viga C | TD | FB
Visit this user's website Find all posts by this user
Quote this message in a reply
05-13-2016, 11:27 PM
Post: #3
RE: A query on Graphics Syntax
(05-13-2016 11:11 PM)Carlos295pz Wrote:  No es posible crear variables gráficas. Sí es posible crear gráficos Nombrados con ICON.

Los G0-9 siempre son operados como expresiones, por lo que al hacer:
GN:=G7 o GN:='G7' es lo mismo. Ambos hacen referencia a la variable gráfica G7.

Al hacer:
DIMGROB(GN,320,240); se esta configurando G7
También falta señalar que se haga por pixel -> DIMGROB_P

Esta expresión redefine tamaño y contenido.
GN:=AFiles("BSL_A"); Por lo que no era necesario dimensionar GN (G7) anteriormente.

En tu código creado se puede obtener el gráfico en pantalla con GN o G7.
BLIT(G0,GN) = BLIT(GN) = BLIT(G7)

Esto es un error
BLIT_P(G0,AFiles("BSL_A"));
BLIT necesita como parámetros una referencia a variables gráficas o una fuente, como:
G0: Pantalla
G7: Varible gráfica temporal
Ocurrirá error si se intenta pasar AFiles("BSL_A") ya que no es una referencia, estos son datos puros, al cual BLIT no esta preparado para recibirlo.

I think it is possible to include an English translation so that everybody may understand what you are talking about. I myself would prefer German but that does not really matter as I also am capable of using English and French, but that is all and enough.
Arno
Find all posts by this user
Quote this message in a reply
05-14-2016, 12:01 AM
Post: #4
RE: A query on Graphics Syntax
I forgot translate, he
Quote:You can not create graphical variables. It is possible to create graphics Named with ICON.

The G0-9 are always operated as expressions, so to do:
GN:=G7 or GN:='G7' is it same. Both refer to the graph variable G7.

In doing:
DIMGROB (GN, 320, 240); It is setting G7 "DIMGROB (G7, 320, 240)"
Also missing point is made by pixel -> DIMGROB_P

This expression redefines size and content.
GN:= Afiles("BSL_A"); So it was not necessary to size GN (G7) above.

Created in your code you can get the graphic on screen with GN or G7.
BLIT(G0, GN) = BLIT(GN) = BLIT(G7)

This is an error
BLIT_P (G0, Afiles ("BSL_A"));
BLIT need as parameters a reference to a source or graphic variables, such as:
G0: Display
G7: Variable temporarily storing graphic objects
Error will occur if you try to pass Afiles ("BSL_A") because it is not a reference, these are raw data, which BLIT is not ready to receive it.

Viga C | TD | FB
Visit this user's website Find all posts by this user
Quote this message in a reply
05-17-2016, 04:47 AM
Post: #5
RE: A query on Graphics Syntax
Hello,

G0-G9 are the only general purpose graphical variables (for historical reasons).

ICON are fast, read only graphical variables. Their original intent was for small blobs of graphics for sprites and other similar objects. You can use them as a source of blit, but that is about it. They are as fast as G0-G9.

AFiles are really image files storage. They are read write, but are very slow. They should be replacing ICONS now that they exits. With a pre-load for often use ones.

Cyrille

Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP.
Find all posts by this user
Quote this message in a reply
05-17-2016, 04:42 PM
Post: #6
RE: A query on Graphics Syntax
And we will investigate relaxing this restriction around just the 10 G0-G9. There are some challenges, but it may be possible. Part of the concern is getting memory usage out of control because it is so trivial to make a giant bitmap and leave it around consuming all the RAM.

TW

Although I work for the HP calculator group, the views and opinions I post here are my own.
Find all posts by this user
Quote this message in a reply
Post Reply 




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