FlashCanvas Pro 1.5 released

What's new in FlashCanvas Pro 1.5?

(Enhancements)

  • Improvements to drawImage() and createPattern().
    • Further optimization.
    • Implement error handling.
    • Accept any object that has a src property.
  • Supported a few new options.
    • "swfPath" option
    • "imageCacheSize" option
    • "usePolicyFile" option
  • Supported asynchronous loading of flashcanvas.js.
  • Made it possible to set the options via a window.FlashCanvasOptions object.
  • Throw an exception if the given arguments are invalid.

(Bug fixes)

  • The combination of clip() and globalCompositeOperation was not supported.
  • Shapes with shadow were displayed in the wrong position when clipped.
  • arcTo() occasionally drew a straight line of infinite length by error.
  • arc() didn't add the start point to the subpath when the startAngle and the endAngle were the same.
  • restore() didn't restore the clipping region correctly.
  • clearRect() should not clear the pixels outside the clipping region.
  • Special characters in a url need to be escaped when passed to Flash.
  • toDataURL("image/jpeg") must composite the image to a black background.
  • Many minor bug fixes thanks to the canvas test suite developed by Philip Taylor.

Links

FlashCanvas-20110201 released

What's new in FlashCanvas-20110201?

(Enhancements)

  • Improvements to drawImage() and createPattern().
    • Implement error handling.
    • Accept any object that has a src property.
  • Supported asynchronous loading of flashcanvas.js.
  • Throw an exception if the given arguments are invalid.

(Bug fixes)

  • Backported the arcTo() code from FlashCanvas Pro.
  • restore() didn't restore the clipping region correctly.
  • clearRect() should not clear the pixels outside the clipping region.
  • Special characters in a url need to be escaped when passed to Flash.
  • toDataURL("image/jpeg") must composite the image to a black background.
  • Many minor bug fixes thanks to the canvas test suite developed by Philip Taylor.

Links

FlashCanvas Pro 1.4 released

What's new in FlashCanvas Pro 1.4?

(Enhancements)

  • Added new features to drawImage() and createPattern().
    • Made it possible to take an HTMLCanvasElement as an argument.
    • Made it possible to load image files from other domain.
  • Prepared FlashCanvas.saveImage() method.
  • textAlign gets to support the directionality of "rtl".
  • Refactored the handling of resize event.
  • Some performance improvements.

(Bug fixes)

  • Canvas was rendered incorrectly when printed.
    • Canvas was expanded if the page was in quirks mode.
    • The background was painted gray.
  • Tweaked the color parser to check the input more strictly.
  • Shadows were not rendered according to the drawing model.

(etc.)

  • Included canvas2png.js script that can be used to save a canvas image.
  • Included more benchmark programs and test cases.
  • Made the examples compatible with IE9.

Canvas-to-canvas copy

From this version, drawImage() and createPattern() methods can take an HTMLCanvasElement as an argument. But you should know that this canvas-to-canvas copy feature has a restriction originated from Flash; you cannot copy an image from hidden/offscreen canvases. For example, here is a result of my little experiment.
<canvas id="canvas1" width="100" height="100"></canvas>
<canvas id="canvas2" width="100" height="100"></canvas>
<style>
#canvas1 {
    position: absolute;
    left: -99px;
}
</style>
This canvas1 is nearly hidden, but its right edge is inside the screen. In this case, we can copy the image from canvas1 to canvas2 without problems. If we change the position to {left: -100px}, however, canvas1 becomes entirely hidden, and the copy fails.

Links

FlashCanvas-20101115 released

What's new in FlashCanvas-20101115?

(Enhancements)

  • Made it possible to load image files from other domain.
  • Prepared FlashCanvas.saveImage() method.
  • Modified strokeText() to draw an outline of the text.
  • textAlign gets to support the directionality of "rtl".
  • Refactored the handling of resize event.

(Bug fixes)

  • Canvas was rendered incorrectly when printed.
    • Canvas was expanded if the page was in quirks mode.
    • The background was painted gray.
  • Tweaked the color parser to check the input more strictly.

(etc.)

  • Included canvas2png.js script that can be used to save a canvas image.
  • Made the examples compatible with IE9.

canvas2png.js

When you need to save a canvas image as an image file, Canvas2Image library is a commonly-used solution. Unfortunately, however, this library does not work well with some browsers such as Internet Explorer.

As an alternative and cross-browser solution, we prepared canvas2png.js script that works with all major browsers. This script saves a canvas image as a PNG file with the help of save.php script. canvas2png.js provides only one function, canvas2png(), that takes an HTMLCanvasElement as an argument and can be used in the following way.

var canvas = document.getElementById("mycanvas");
canvss2png(canvas);

Links

FlashCanvas Pro 1.3 released

What's new in FlashCanvas Pro 1.3?

(Enhancements)

  • Supported data URI scheme in drawImage() and createPattern().
  • Supported repetitions of "repeat-x", "repeat-y" and "no-repeat" in createPattern().
  • Made it possible to call initElement() before appendChild().
  • Switched to use JavaScript implementation of measureText().

(Bug fixes)

  • Line styles were not set when the strokeStyle attribute was a CanvasGradient or CanvasPattern object.
  • Patterns were painted ignoring the globalAlpha attribute.
  • Patterns assigned to the strokeStyle attribute were not transformed.
  • The transformation matrix mistakenly affected the shadowOffsetX and shadowOffsetY attributes.
  • arc() didn't add the end point to the subpath when the central angle was greater than 2 pi.
  • closePath() must do nothing if the context has no subpaths.
  • IE8 didn't preload the swf file when the URL was a relative one.
  • Resize event canceled createLinearGradient().
  • The disableContextMenu option disabled mouse clicks on the outside of the canvas element.
  • Many minor bug fixes.

Links

FlashCanvas-20100904 released

What's new in FlashCanvas-20100904?

(Enhancements)

  • Reimplemented fillText().
    • Supported transformations of text.
    • Supported an alpha value of a color.
    • Supported font size with a unit other than "px".
    • Supported font family that contains white spaces in its name.
    • Supported the textAlign attribute of "start" and "end".
    • Gradients and patterns are not supported yet.
  • Implemented strokeText().
    • At present, strokeText() fills text as fillText() does.
  • Implemented measureText().
  • Made it possible to call initElement() before appendChild().
  • Prepared FlashCanvas.setOptions() method for future use.

(Bug fixes)

  • Line styles were not set when the strokeStyle attribute was a CanvasGradient or CanvasPattern object.
  • Patterns were painted ignoring the globalAlpha attribute.
  • arc() didn't add the end point to the subpath when the central angle was greater than 2 pi.
  • closePath() must do nothing if the context has no subpaths.
  • IE8 didn't preload the swf file when the URL was a relative one.
  • Many minor bug fixes.

Improved support for Canvas Text API

This release of FlashCanvas finally supports fillText(), strokeText() and measureText() methods, though they still have some problems. Please see the following examples from Canvas text project.

Links

FlashCanvas Pro 1.3 beta2 released

What's new in FlashCanvas Pro 1.3 beta2?

  • Enabled the turbo mode again on Flash Player 10.1.

Revival of the turbo mode

Flash Player 10.1.53.64 has a bug that the value of FlashVars cannot be changed. Because of this bug, I temporarily disabled the turbo mode in Flash Canvas Pro 1.2.1.

The good news is that this bug is fixed in Flash Player 10.1.82.76 which was released recently. Therefore, I modified the code so that the turbo mode was disabled only when the version of Flash Player was 10.1.53.64.

Links