You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to draw on internal image memory, tried the given code in the documentation, but following error has occurred. Also, I need this function very much.
Python 3.12.3 (tags/v3.12.3:f6650f9, Apr 9 2024, 14:05:25) [MSC v.1938 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import aggdraw
>>> d = aggdraw.Draw("RGB", (320, 200), "white")
>>> p = aggdraw.Pen("black", 0.5)
>>> d.line((0, 0, 500, 500), p)
>>> d.line((0, 500, 500, 0), p)
>>> s = d.tostring()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'Draw' object has no attribute 'tostring'
>>>
Any kind of help will be appreciated.
Thank you.
The text was updated successfully, but these errors were encountered:
The main thing was to match changes in Pillow (PIL) and Python itself where tostring was replaced by tobytes in Python 3 (if I'm remembering this correctly). It looks like all the actual code got updated, but not the example code.
So using tobytes should work. Let me know if it doesn't.
I sincerely appreciate your kind reply and great support. While I was aware that the documentation might be old, I wasn’t aware of the crucial detail that tostring had been replaced by tobytes. After investigating the tobytes method, I can confirm that it functions correctly and perfectly fine.
Screenshot attachment (solved): Thank you immensely! 😊
Regards
I want to draw on internal image memory, tried the given code in the documentation, but following error has occurred. Also, I need this function very much.
Any kind of help will be appreciated.
Thank you.
The text was updated successfully, but these errors were encountered: