Forum Discussion

gwerner's avatar
gwerner
Visitor
13 years ago

Direct bimap access

Is there any possible way to access pixel data on bitmaps (maybe through the NDA-protected SDK)? I am making an app that has to generate real-time charts on an roScreen through bitmaps, but it seems I'm strictly limited to lines and boxes. Doesn't really bode well for pie charts, etc.

I'm also open to any "hacky" ways of doing this. Any hints would be appreciated.

6 Replies

  • I would think it should be possible to create pie charts on the newer firmware devices without that, using some ingenuity and DrawRotatedObject().

    However:

    ifDraw2d supports GetByteArray

    GetByteArray(x as Integer, y as Integer, width as Integer, height as Integer) as Object

    Returns an roByteArray representing the 32 bit RGBA pixel values for the rectangle described by the parameters

    so if you really want to, you could probably iterate over that, write it to tmp:/using ifByteArray and read it back in as a new image file.

    Also, you might look at LibRokuDev which has some png manipulation functions.

    - Joel
  • "RokuJoel" wrote:
    so if you really want to, you could probably iterate over that, write it to tmp:/using ifByteArray and read it back in as a new image file.

    Unfortunately, roBitmap won't read raw bitmaps (only PNG or JPG), so that wouldn't work. The ability to natively save an roBitmap as a png would be a very welcome feature. Doing so programmatically via Brightscript is far too slow to be practical.
  • "RokuJoel" wrote:
    I would think it should be possible to create pie charts on the newer firmware devices without that, using some ingenuity and DrawRotatedObject().

    Documentation says "Theta is currently limited to 0, 90, 180, and 270 degrees.", so won't work for pie slices (or other rotational objects). Unless that has changed, has it?
  • "EnTerr" wrote:
    "RokuJoel" wrote:
    I would think it should be possible to create pie charts on the newer firmware devices without that, using some ingenuity and DrawRotatedObject().

    Documentation says "Theta is currently limited to 0, 90, 180, and 270 degrees.", so won't work for pie slices (or other rotational objects). Unless that has changed, has it?

    It has for 5.X firmware devices, but not 3.X devices.
  • "TheEndless" wrote:
    "EnTerr" wrote:
    "RokuJoel" wrote:
    I would think it should be possible to create pie charts on the newer firmware devices without that, using some ingenuity and DrawRotatedObject().

    Documentation says "Theta is currently limited to 0, 90, 180, and 270 degrees.", so won't work for pie slices (or other rotational objects). Unless that has changed, has it?

    It has for 5.X firmware devices, but not 3.X devices.

    Pray tell more? And maybe someone will update docs too.
  • "EnTerr" wrote:
    "TheEndless" wrote:
    "EnTerr" wrote:
    Documentation says "Theta is currently limited to 0, 90, 180, and 270 degrees.", so won't work for pie slices (or other rotational objects). Unless that has changed, has it?

    It has for 5.X firmware devices, but not 3.X devices.

    Pray tell more? And maybe someone will update docs too.

    As far as I'm aware, at some point in the late 4.X builds, they added the ability to specify any theta for DrawRotatedObject... not much else to tell, I don't think.