简体   繁体   English

如何调整从 servlet 生成的 GWT 图像的大小?

[英]How to resize GWT image generated from servlet?


I have a servlet that generates PNG using data in database...then in my GWT Application i use the servlet URL to get the image, all of this work perfectly, but the problem is i can't modify the size of image to fit the box reserved to it since the image is generated from servlet.Is there a method to modify dimensions when generating image?我有一个使用数据库中的数据生成 PNG 的 servlet ......然后在我的 GWT 应用程序中,我使用 servlet URL 来获取图像,所有这些工作完美,但问题是我无法修改图像的大小以适应由于图像是从 servlet 生成的,因此保留给它的框。生成图像时是否有修改尺寸的方法? or may be client side solution to setup image's size?或者可能是设置图像大小的客户端解决方案? Any ideas how I'd do this?有什么想法我会怎么做? Thanks in advance,提前致谢,

I am assuming you are loading it in a gwt Image widget.我假设您将它加载到 gwt Image 小部件中。 If so, just use the widget functions of setWidth( "10px") and setHeight( "10px") on the client side.如果是这样,只需在客户端使用setWidth( "10px")setHeight( "10px")的小部件功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM