Post Reply 
Python: How do I save a graphic?
01-07-2023, 10:49 PM
Post: #14
RE: Python: How do I save a graphic?
Guenter,

Thank you. I see now from your example code that the use of PPL 'EVAL()' routine is not needed.

The code below works without the need for 'EVAL()':
Code:

import hpprime

def screen_cap():
  hpprime.eval('DIMGROB_P(G1,320,240)') 
  hpprime.eval('RECT()')
  hpprime.eval('RECT_P(G1,40,40,280,200,#000000,#00FF00)') 
  b="pic.png"
  t='AFiles("'+b+'"):=G1'
  print(t)
  m=hpprime.eval(t)
  print(m)
screen_cap()

Thanks for the recommendation to use the Python versions of the graphics routines. They are faster Smile than the PPL versions.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Python: How do I save a graphic? - leibniz - 01-07-2023 10:49 PM



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