• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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
 
If you are using a wood chipper, you are doing it wrong. Even on this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic