douyu3145 2014-05-15 20:16
浏览 42
已采纳

调整图像大小而不实际更改文件夹中的图像

so I'm using Autocomplete. I'm using it to display images left to the search results. The image displayed is from the products table, and that image is a around 400x400 px. But, in the autocomplete, it wouldn't be possible to show that image. Suppose I need an image of 50x50 px, how would I make the function that re-sizes the image (just to show) and the actual image is still 400x400 px ?

Here's my products table :-

productid         productname  price  image
autoincrement       somename    100    ../productimages/someimage.extension

Now this image is available in php as $result->image. I have no idea as to how I can start. Any suggestions are welcome.

  • 写回答

2条回答 默认 最新

  • dqzlqfqeh845799833 2014-05-15 20:19
    关注

    It would be a lot of hassle to save a temporary image etc. Why don't you just display it in HTML using the desired width?

    <img src="someimage.extension" class="thumbnail"/>
    <style>
        .thumbnail {
            width: 50px;
        }
    </style>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 易康econgnition精度验证
  • ¥15 线程问题判断多次进入
  • ¥15 msix packaging tool打包问题
  • ¥28 微信小程序开发页面布局没问题,真机调试的时候页面布局就乱了
  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致