Show More
@@ -488,11 +488,14 b' class Image(DisplayObject):' | |||||
488 | Parameters |
|
488 | Parameters | |
489 | ---------- |
|
489 | ---------- | |
490 | data : unicode, str or bytes |
|
490 | data : unicode, str or bytes | |
491 |
The raw data or a URL |
|
491 | The raw image data or a URL or filename to load the data from. | |
|
492 | This always results in embedded image data. | |||
492 | url : unicode |
|
493 | url : unicode | |
493 | A URL to download the data from. |
|
494 | A URL to download the data from. If you specify `url=`, | |
|
495 | the image data will not be embedded unless you also specify `embed=True`. | |||
494 | filename : unicode |
|
496 | filename : unicode | |
495 | Path to a local file to load the data from. |
|
497 | Path to a local file to load the data from. | |
|
498 | Images from a file are always embedded. | |||
496 | format : unicode |
|
499 | format : unicode | |
497 | The format of the image data (png/jpeg/jpg). If a filename or URL is given |
|
500 | The format of the image data (png/jpeg/jpg). If a filename or URL is given | |
498 | for format will be inferred from the filename extension. |
|
501 | for format will be inferred from the filename extension. | |
@@ -512,11 +515,17 b' class Image(DisplayObject):' | |||||
512 |
|
515 | |||
513 | Examples |
|
516 | Examples | |
514 | -------- |
|
517 | -------- | |
515 |
# embed |
|
518 | # embedded image data, works in qtconsole and notebook | |
|
519 | # when passed positionally, the first arg can be any of raw image data, | |||
|
520 | # a URL, or a filename from which to load image data. | |||
|
521 | # The result is always embedding image data for inline images. | |||
516 | Image('http://www.google.fr/images/srpr/logo3w.png') |
|
522 | Image('http://www.google.fr/images/srpr/logo3w.png') | |
|
523 | Image('/path/to/image.jpg') | |||
|
524 | Image(b'RAW_PNG_DATA...') | |||
517 |
|
525 | |||
518 | # embed implicitly False, does not works in qtconsole but works in notebook if |
|
526 | # Specifying Image(url=...) does not embed the image data, | |
519 | # internet connection available |
|
527 | # it only generates `<img>` tag with a link to the source. | |
|
528 | # This will not work in the qtconsole or offline. | |||
520 | Image(url='http://www.google.fr/images/srpr/logo3w.png') |
|
529 | Image(url='http://www.google.fr/images/srpr/logo3w.png') | |
521 |
|
530 | |||
522 | """ |
|
531 | """ |
General Comments 0
You need to be logged in to leave comments.
Login now