Record and Playback Drawing in HTML5 Canvas – Part II

A reader of my blog post De/Serializing Recordings in Recordable HTML5 Canvas had asked me how to change stroke color and size when recording. I told him that this could be done by adding actions, like setColor and setStrokeSize. For more information about how the recordable canvas was implemented, see my blog post Record and Playback Drawing in HTML5 Canvas . I have updated the example with following new features –

  • Setting stroke color and size – both for drawing and recording
  • Pausing and resuming recording. You may want to pause recording if, for example, you do not want to record time delay when you select stroke color/size. Duration of time that the recording is paused is skipped when playing back the recording.

Here is the demo of how the new features work. Select a color by clicking on any color box on the right side of the canvas. Default selection is black. Currently selected color is displayed in a little bigger box with rounded corner. To select stroke size, I have added a few predefined circles of different sizes on the right side. Currently selected stroke size is displayed in black.

Continue reading “Record and Playback Drawing in HTML5 Canvas – Part II”

My blog report for 2013

WordPress has created a nice summary of statistics of my blog for the year 2013. The report is available at http://jetpack.me/annual-report/33403624/2013/

Here are some of the highlights –

  • I wrote 15 blog posts in 2013, taking the total posts to 47. So I wrote a lot less posts in 2013 compared to 2012, the year I started this blog.
  • There were 83000 views of the blog in 2013
  • Many of the posts viewed this year were actually written last year. The most popular post was  Passing data between pages in JQuery Mobile followed by  Calling Objective-C code from JavaScript in iOS applications
  • Other than search engines, top two referring sites were stackoverflow.com and jquerymobile.com
  • Visitors came from 168 countries. Most from USA, followed by India and Germany

-Ram Kulkarni

Framework for interacting with embedded WebView in iOS application

Last year around the same time I had written a post about Calling Objective-C code from JavaScript in iOS applications . I created a simple framework for it and described how to use it in that post.

Recently I was working on an application that required WebView to be embedded in the same View Controller along with other native iOS controls. I decided to use the above framework, but knew that  my ViewController class will have to extend WebViewController class of the framework. Though I could have done that, I thought separating the functionality of UIWebViewDelegate from the WebViewController would be a better design. So I replaced WebViewController with WebViewDelegate which implements UIWebViewDelegate protocol. I also removed getInitialPageName method from WebViewInterface.h . So here are the files in the new framework – Continue reading “Framework for interacting with embedded WebView in iOS application”

Social