Skip to main content
September 19, 2006
Question

Creating bitmaps

  • September 19, 2006
  • 1 reply
  • 384 views
Thinking of doing a multiuser white board application. The idea is that there are many rooms where 15 to 30 users can simultaneously paint on a canvas over the course of three hours.

The problem I'm having is this: If each painting session lasts for three hours, and if someone were to join two and a half hours into the session, I'm going to need to send them all the canvas information up to that point. However, I'm thinking I can't do this as just objects or arrays of data. By my calculation, this could be megs and megs of data towards the end of the three hours.

Is there any way for the Flash Media Server to somehow create bitmap snapshots of the canvas at certain intervals and send that to users who join late in the process? Or am I thinking about this in the wrong way?
    This topic has been closed for replies.

    1 reply

    September 19, 2006
    No... FMS cannot save a bitmap for you.

    Actually, you are looking at this the wrong way. For a whiteboard, what you want to do is send drawing data to the clients, and let the client (the flash movie) do the actual drawing using Flash's drawing classes.

    There is a whiteboard component in the Communication Components. It's written in AS1, so you can look at the code of the component (and the accompanying whiteboard.asc in the FMS scriptlib. This will show you how the data is saved to a shared object without creating data for each pixel on the whiteboard.
    September 19, 2006
    Yes, that was what I originally had in mind as well. However, like i said, the idea is that this could be 30 people in one room drawing over the course of 3 hours. Even if you capture just simple drawing data, it really starts to add up after a while and can spin out of control.
    September 20, 2006
    I suppose it depends on how cluttered the whiteboard stage gets... and how efficient your data structure is.

    For example, let's say someone draws a square. The data you might need is width, height, fill color, line color, line weight, x, y, and z. All in all, that's just a few bytes. Even if you have a thousand rectangles on the stage, it's still not all much data.