ropensci / magick

Magic, madness, heaven, sin
https://docs.ropensci.org/magick
Other
462 stars 65 forks source link

how to read the image when call pyautogui by reticulate? #354

Closed leechaowen closed 1 year ago

leechaowen commented 2 years ago

I need to take screen. run below code is ok. but how to read the fullscreen by R? i do not want to save to harddisk the read again.

library(reticulate)

library(magick)

pyautogui<-import("pyautogui")

fullscreen=pyautogui$screenshot()

fullscreen$show()
leechaowen commented 2 years ago
> image_read(fullscreen)
Error in image_read(fullscreen) : 
  path must be URL, filename or raw vector
> image_read(py$fullscreen)
Error in py_get_attr_impl(x, name, silent) : 
  AttributeError: module '__main__' has no attribute 'fullscreen'
leechaowen commented 2 years ago

Do someone know how to take screen by R not depend on python?