• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Canvas Conversion

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!

I am developing a software that runs on an MIDP 2.0 compatible phone. In some part of the program, the user draws something on the canvas. What he/she did draw should be sent to some PC over GPRS. I have no problem sending data over GPRS or making the user draw on the canvas. The problem I have is converting what has been drawn on the phone to some image. This image could be any format (png, jpg, etc.) as long as it can be displayed by a web browser, because this image will be accesed by other users via their web browsers. Can anyone help me on converting the drawing on the canvas to some image file? (Conversion can be done either on the phone or on the server side. I have Java programs on the server side. All I need to do is to have something like a byte array which can be converted to an image later) . Thanks in advance....
 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try this one:


Have in mind that this may take a lot of memory depending on the screen size.
You may need to call several times Image.getRGB(...) and send it in pieces.

May be you could use a simple Run Lenght Encoding to compress the data before you send it.

Yuri
 
Murat Soyupak
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks a lot...
 
Yuri Magrisso
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm glad it helps
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello

Can you give the code to inject this code with httpConnection POST ?

Thanks for your help
 
"I know this defies the law of gravity... but I never studied law." -B. Bunny Defiant tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic