Hi Claudio, thank you for your post. You method could only be used if implemented on the server side.
GWT does not support the awt API. Regards! 2016-01-27 8:01 GMT-02:00 Kirill Prazdnikov <[email protected]>: > How do you use AWT code in client GWT code ? > > > On Wednesday, January 27, 2016 at 12:19:15 PM UTC+3, claudio sergio > Goncalves wrote: >> >> Hi julio >> >> i use this routine to redimensione my images >> >> public static BufferedImage redimensionarImagem(BufferedImage img, int >> maltura, int mlargura) throws Exception { >> >> java.awt.Image imagem = (java.awt.Image) img; >> java.awt.Image thumbs = ((java.awt.Image) imagem) >> .getScaledInstance(mlargura, maltura, BufferedImage.SCALE_SMOOTH); >> BufferedImage buffer = new BufferedImage(mlargura, maltura, >> BufferedImage.TYPE_INT_RGB); >> buffer.createGraphics().drawImage(thumbs, 0, 0, null); >> return buffer; >> } >> pass the width and height in pixels (maltura e mlargura) >> After thar you can upload the image. >> >> cheers >> >> Claudio >> >> >> Em quinta-feira, 14 de janeiro de 2016 11:25:29 UTC-2, Julio Heitor >> Nobrega escreveu: >>> >>> Hi guys, >>> >>> i am trying to upload images with 2mb size but i don't want to send the >>> whole original image to the server. >>> >>> What i would like to do is reduce the image dimensions from, for >>> example, *1000x1000* to *50x50* and reduce the file size >>> from *2mb* to *~25kb* as well and at the end send the *~25kb* image to >>> the server. >>> >>> I know there is the Scalr framework that does that in java, but its no >>> compatible with GWT clients. >>> >>> Is there any client side GWT library that does the same thing as Scalr? >>> >>> Best Regards! >>> >>> >>> -- > You received this message because you are subscribed to a topic in the > Google Groups "GWT Users" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/google-web-toolkit/8OfazCLtcLA/unsubscribe > . > To unsubscribe from this group and all its topics, send an email to > [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/google-web-toolkit. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "GWT Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/d/optout.
