not really known
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
560 B

  1. /**
  2. _enyo.canvas.Image_ is a canvas control that draws an image, stretched to
  3. fit the rectangle specified by the _bounds_ property.
  4. */
  5. enyo.kind({
  6. name: "enyo.canvas.Image",
  7. kind: enyo.canvas.Control,
  8. published: {
  9. //* Source URL for the image
  10. src: ""
  11. },
  12. //* @protected
  13. create: function() {
  14. this.image = new Image();
  15. this.inherited(arguments);
  16. this.srcChanged();
  17. },
  18. srcChanged: function() {
  19. if (this.src) {
  20. this.image.src = this.src;
  21. }
  22. },
  23. renderSelf: function(ctx) {
  24. ctx.drawImage(this.image, this.bounds.l, this.bounds.t);
  25. }
  26. });