Skip to content

Screen().img got renamed to Screen()._img and is now also missing from the docs. #142

Closed

Description

@ensonic

In open-roberta I was using this code to show image in the screen:

image = Image.frombytes('1', (178, 128), IMAGES[picture], 'raw', '1;IR', 0, 1)
lcd = ev3dev.Screen()
lcd.img.paste(image, (0, 0))
lcd.update()

I could fix this by now doing

- lcd.img.paste(image, (0, 0))
+ lcd._img.paste(image, (0, 0))

I can't find when that changed. Anyway this is not about blaming :) Can we expose this in a nicer way properly?

Activity

  1. ddemidov commented on Mar 11, 2016

    @ddemidov
    Member

    The field was always intended to be internal, hence the missing docs. What you are doing makes sense though, so we can expose the field either directly or with a property. Care to make a PR?

  2. ddemidov commented on Mar 11, 2016

    @ddemidov
    Member

    It looks like the change came with the switch from old boost-based implementation to the new pure python one.

  3. ensonic commented on Mar 11, 2016

    @ensonic
    ContributorAuthor

    Yep, I'll make a PR. Shall we just expose img like we expose draw or add a proxy method for img.paste()?

  4. ddemidov commented on Mar 11, 2016

    @ddemidov
    Member

    Is there anything else potentially useful in the Image inteface besides paste()? I have little experience with the Pillow library.

  5. ensonic commented on Mar 14, 2016

    @ensonic
    ContributorAuthor

    Here is the reference: https://pillow.readthedocs.org/en/3.0.0/reference/Image.html. I can't think of anything else I would need from there right now. I think it is unfortunate that draw does not have a method to blit an image.

  6. ddemidov commented on Mar 14, 2016

    @ddemidov
    Member

    I think just exposing the image field would be both easier and future proof :).

  7. added a commit that references this issue on Mar 17, 2016
    decb8ef
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions