great, the amount of solutions i find in others' "broken" code is unreal
:)))
On Thursday, June 7, 2018 at 1:58:29 PM UTC+8, John Smith wrote:
>
> Thanks. Was also looking for this.
>
> On Wednesday, May 16, 2018 at 5:00:41 PM UTC+5, Gareth Murfin wrote:
>>
>> I have an upload method that works with all the images I ever throw at
>> it, apart from the signature component image. So I am assuming there is
>> somethign wrong with the image from the sig component maybe?
>>
>> I simply do this
>>
>> signature = sig.getSignatureImage();
>> Image myImage = Image.createImage(signature.getWidth(),
>> signature.getHeight());
>> myImage.getGraphics().drawImage(signature, 0, 0);
>> upload(incident_id,question.question_id,myImage,false); //my upload
>> mehtod that works with other images,
>>
>> Can you see any issues?
>>
>>
>>
>> upload basically does this an embeds the base64 into json:
>> String base64 = null;
>> try {
>> ImageIO imgIO = ImageIO.getImageIO();
>> ByteArrayOutputStream out = new ByteArrayOutputStream();
>> imgIO.save(photo, out, ImageIO.FORMAT_JPEG, 0.8f);
>> byte[] ba = out.toByteArray();
>> base64 = Base64.encode(ba);
>> // toast("Uploading image",currentForm);
>> } catch (Exception e) {
>> _("//// error uploading photo "+e.getMessage());
>> e.printStackTrace();
>> }
>>
>
--
You received this message because you are subscribed to the Google Groups
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit
https://groups.google.com/d/msgid/codenameone-discussions/6b5514e1-c3d8-4f23-b052-cacdd00f2f98%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.