- 动态调整大小/裁剪图片 [英] - Dynamically Resizing/Cropping Pictures

查看:85
本文介绍了 - 动态调整大小/裁剪图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在一个固定的维度空间中显示一堆各种尺寸的图片

,就像MSN Messenger在其聊天时用其用户照片

窗户。


强制图像尺寸会扭曲比例,所以'没有用。


强制一个坐标,而另一个坐标保持灵活将保持

比例,但x,y值不会在图片之间保持一致。


我认为MSN Messenger方法带来一个坐标为

100像素,然后只显示其他

坐标的PART信息。我不确定你们是否知道我在说什么,但

Messenger会缩小(例如)宽度为100像素,保持高度

比例,但只显示高度的中间100个像素(或者是相反的另一种方式是
)。


我该怎么办?相似的东西?也许涉及将图像放置为

背景而不是前景元素?


如何重新创建用于显示图像的MSN Messenger公式

恒定尺寸而不会丢失比例(但丢失不必要的

图像部分)?


谢谢。

解决方案

" Jon Yeager" < 1@1.1>写道:

我需要将一堆各种尺寸的图片显示到一个固定的维度空间,就像MSN Messenger用它的用户照片一样
在聊天窗口中。

强制图像尺寸会扭曲比例,所以没有用。

强制一个坐标,而另一个坐标保持灵活将保持比例,但x,y值不会在图片之间保持一致。

我认为MSN Messenger方法将其中一个坐标带到了100像素,然后仅显示其他
坐标信息的PART。我不确定你们是否知道我在说什么,但是
Messenger会缩小(例如)宽度为100像素,保持高度
比例,但只显示中间100像素的高度(或者是相反的方式?无论如何)。

我怎样才能做类似的事情?也许涉及将图像作为背景而不是前景元素放置?

如何重新创建MSN Messenger公式,以便在不丢失比例的情况下以恒定维度显示图像(但是丢失不必要的图像部分)?




浏览器在调整图像大小时做得很差,更好地改变实际的图片b



-

Spartanicus


对不起,不是一个选项。


如果有人有任何优惠,仍在寻找以下问题的帮助!


" Spartanicus" < me@privacy.net>在留言中写道

news:ad ******************************** @ news.spart anicus.utvinternet.ie ...

" Jon Yeager" < 1@1.1>写道:

我需要将一堆各种尺寸的图片显示到一个固定的维度空间,就像MSN Messenger与其用户一样
photosin聊天窗口。

强制图像尺寸会扭曲比例,所以'没有用。

强制一个坐标,而另一个坐标保持灵活将保持
比例,但x,y值不会从图片到
图片一致。
我认为MSN Messenger方法将其中一个坐标
带到100像素,然后只显示部分信息的其他
坐标。我不确定你们是否知道我在说什么,但
Messenger会缩小(例如)宽度为100像素,保持
heightproportionate,但只显示中间100高度的像素(或者是另一种方式是
)?

我怎样才能做类似的事情?也许涉及将图像作为背景而不是前景元素放置?

如何重新创建MSN Messenger公式,以便在不丢失比例的情况下以恒定维度显示图像(但是丢失
不必要的图像部分)?



浏览器在调整图像大小时做得很差,更好地改变实际的图像。

-
Spartanicus



" Jon Yeager" < 1@1.1>写道:


请不要在这里发帖,更正一次。

我需要将一堆各种尺寸的图片显示在固定的维度空间中,就像MSN Messenger在聊天窗口中使用其用户
照片一样。


浏览器在调整图像大小时做得很差,更好地更改实际的图像。


对不起,不是一个选项。


为什么不呢?

如果有人有任何优惠,仍在寻找以下问题的帮助!



对不起,不可能。您可以通过将

图像编码为居中的背景图像到固定宽度的块级

元素来实现统一尺寸,但是没有办法调用浏览器调整大小机制

用于背景图片。


HTH


-

Spartanicus


I need to display a bunch of pictures that are all of various dimensions
into a fixed dimension space, like MSN Messenger does with its user photos
in the chat windows.

Forcing image dimensions will warp the proportions, so that''s no good.

Forcing one coordinate while leaving the other flexible will maintain
proportions, but the x,y values won''t be consistant from picture to picture.

I considered the MSN Messenger method of bringing one of the coordinates to
100 pixels, and then showing only PART of the information of the other
coordinate. I''m not sure if you guys know what I''m talking about, but
Messenger will shrink (for example) the width to 100 pixels, keep the height
proportionate, but only show the middle 100 pixels of the height (or is it
the other way around? no matter).

How can I do something similar? Perhaps involving placing an image as a
background instead of a foreground element?

How can I recreate the MSN Messenger formula for displaying images in
constant dimensions without losing the proportions (but losing unnecessary
sections of the image)?

Thanks.

解决方案

"Jon Yeager" <1@1.1> wrote:

I need to display a bunch of pictures that are all of various dimensions
into a fixed dimension space, like MSN Messenger does with its user photos
in the chat windows.

Forcing image dimensions will warp the proportions, so that''s no good.

Forcing one coordinate while leaving the other flexible will maintain
proportions, but the x,y values won''t be consistant from picture to picture.

I considered the MSN Messenger method of bringing one of the coordinates to
100 pixels, and then showing only PART of the information of the other
coordinate. I''m not sure if you guys know what I''m talking about, but
Messenger will shrink (for example) the width to 100 pixels, keep the height
proportionate, but only show the middle 100 pixels of the height (or is it
the other way around? no matter).

How can I do something similar? Perhaps involving placing an image as a
background instead of a foreground element?

How can I recreate the MSN Messenger formula for displaying images in
constant dimensions without losing the proportions (but losing unnecessary
sections of the image)?



Browsers do a poor job when resizing images, better change the actual
images.

--
Spartanicus


Sorry, not an option.

Still looking for help on the below problem, if anyone has any to offer!

"Spartanicus" <me@privacy.net> wrote in message
news:ad********************************@news.spart anicus.utvinternet.ie...

"Jon Yeager" <1@1.1> wrote:

I need to display a bunch of pictures that are all of various dimensions
into a fixed dimension space, like MSN Messenger does with its user photosin the chat windows.

Forcing image dimensions will warp the proportions, so that''s no good.

Forcing one coordinate while leaving the other flexible will maintain
proportions, but the x,y values won''t be consistant from picture to picture.
I considered the MSN Messenger method of bringing one of the coordinates to100 pixels, and then showing only PART of the information of the other
coordinate. I''m not sure if you guys know what I''m talking about, but
Messenger will shrink (for example) the width to 100 pixels, keep the heightproportionate, but only show the middle 100 pixels of the height (or is itthe other way around? no matter).

How can I do something similar? Perhaps involving placing an image as a
background instead of a foreground element?

How can I recreate the MSN Messenger formula for displaying images in
constant dimensions without losing the proportions (but losing unnecessarysections of the image)?



Browsers do a poor job when resizing images, better change the actual
images.

--
Spartanicus



"Jon Yeager" <1@1.1> wrote:

Please don''t top post here, corrected this once.

I need to display a bunch of pictures that are all of various dimensions
into a fixed dimension space, like MSN Messenger does with its user
photos in the chat windows.

Browsers do a poor job when resizing images, better change the actual
images.

Sorry, not an option.
Why not?
Still looking for help on the below problem, if anyone has any to offer!



Sorry not possible. You can achieve the uniform dimensions by coding the
image as a centered background image to a fixed width block level
element, but there is no way to invoke the browsers resizing mechanism
for background images.

HTH

--
Spartanicus


这篇关于 - 动态调整大小/裁剪图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆