标签: scale

如何重写/重新编码网站以进行扩展?

你如何重写一个可扩展的网站?(流量)我主要使用PHP和一些Ruby on rails,我知道它是一个通用的问题.我只是想增加我的知识,所以任何建议都会有用.

先感谢您 ;-)

php scalability cakephp ruby-on-rails scale

4
推荐指数
1
解决办法
542
查看次数

Android ImageView设置Bitmap FitXY不起作用

我一直在尝试设置位图很长时间以使其适合ImageView边界.

它只是无法正常工作scaleType: fitXY.我的位图图像大小低于ImageView's(保存在100X100像素),我希望我的位图图像适合并伸展到ImageView.

这是一些代码:

<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
   android:id="@+id/imageView" 
   android:layout_height="match_parent"
   android:layout_width="match_parent"
   android:src="@drawable/locked_image"
   android:scaleType="fitXY"
/>
Run Code Online (Sandbox Code Playgroud)

这是设置的代码ImageView(我scaleType在不同的地方设置测试):

@Override
public View getView(int position, View convertView, ViewGroup parent) {
  final ImageView imageView;
  if (convertView == null) {
    imageView = (ImageView) getLayoutInflater().inflate(R.layout.item_grid_image, parent, false);
    imageView.setScaleType(ScaleType.FIT_XY);
  } else {
    imageView = (ImageView) convertView;
    imageView.setScaleType(ScaleType.FIT_XY);
  }

  imageLoader.displayImage(imagesIds[position], imageView, options);
  imageView.setScaleType(ScaleType.FIT_XY);
  return imageView;
}
Run Code Online (Sandbox Code Playgroud)

以下是它的外观:

在此输入图像描述

正如你所看到的,高度ImageView很好,但我想它的宽度是一样的.我无法通过我的活动访问我的位图图像,所以请不要让我调整我的位图大小.我真的不明白为什么它不能正常工作.


编辑:
只是为了使问题更容易理解.ImageView计算每个设备的高度.每个设备都不同.我希望我的宽度ImageView与它的高度相同.我正在使用该Two-WayGridView库来显示图像,如果它有任何区别.

android image scale imageview android-imageview

4
推荐指数
1
解决办法
2万
查看次数

按比例调整iframe大小以适应使用jQuery的DIV

我在div中有一个视频的iframe,如下所示:

<div class="media">
    <iframe>
</div>
Run Code Online (Sandbox Code Playgroud)

我在窗口调整大小时动态设置DIV的大小.

我想缩放iframe以适应div内部,同时保持它的纵横比.大多数代码处理缩放图像,这更容易.

这是我到目前为止,但它不起作用:

jQuery.fn.fitToParent = function()
{
    this.each(function()
    {
        var width  = jQuery(this).width();
        var height = jQuery(this).height();
        var parentWidth  = jQuery(this).parent().width();
        var parentHeight = jQuery(this).parent().height();

        if(width < parentWidth)
        {
            newWidth  = parentWidth;
            newHeight = newWidth/width*height;
        }
        else
        {
            newHeight = parentHeight;
            newWidth  = newHeight/height*width;
        }

        jQuery(this).css({
            'height'     :newHeight,
            'width'      :newWidth'
        });
    });
};
Run Code Online (Sandbox Code Playgroud)

基本上,我希望复制"background-size:contains"对CSS中的图像进行的大小调整,但是对于DIV中的iframe.

谢谢您的帮助!

jquery scale aspect-ratio

4
推荐指数
1
解决办法
7746
查看次数

使用CSS缩放所有svg元素

我的问题是我从数据库中收到一堆完整的内联svg字符串,如下所示:

<svg width="640" height="480" xmlns="http://www.w3.org/2000/svg">
 <!-- Created with SVG-edit - http://svg-edit.googlecode.com/ -->
 <g>
  <title>Layer 1</title>
  <path d="m213,174c-1,0 0.93744,4.0507 5,9c15.7598,19.19971 42.15933,40.96863 87,46c41.73807,4.68324 91.75034,-15.54512 112,-41c23.49255,-29.53134 36.13748,-73.41833 14,-96c-33.4342,-34.10505 -95.63815,-20.07648 -149,16c-43.49094,29.40303 -72.81625,61.12003 -83,114c-6.24055,32.40456 16.74812,59.13785 36,65c37.61407,11.45343 70.11282,-8.38123 85,-30c20.052,-29.11902 25.62744,-81.34587 2,-96c-56.33228,-34.93816 -148.52351,-14.6879 -180,-4c-15.29767,5.19435 -26.60644,10.5387 -28,13c-2.03145,3.58792 -1,7 -1,12l2,5l14,8" id="svg_3" stroke-width="5" stroke="#000000" fill="#7fff00"/>
  <path d="m316,134c-62,-30 -126.71272,-58.6663 -180,-88c-12.1703,-6.69953 -20.4588,-10.30656 -21,-9c-2.67879,6.46715 1.96343,18.00821 4,27c2.94713,13.01208 2.5971,18.59676 7,27c2.32053,4.42889 12.9695,11.11737 32,16c27.95625,7.1727 38,10 54,12c8,1 11.23318,-1.93299 14,-12c2.18535,-7.95136 3.35251,-14.97251 -1,-16c-9.73248,-2.29753 -34.42769,3.96417 -50,11c-15.49211,6.9996 -15,18 -7,31l16,9l34,13" id="svg_4" stroke-width="5" stroke="#000000" fill="#003f7f"/>
  <path d="m545,160c-75,-19 -106.09659,-19.87175 -136,-23c-28.13077,-2.94281 -43,-8 -46,-10c-3,-2 -3.87857,-4.49346 -7,-5c-4.93542,-0.80091 -12.43283,5.65108 …
Run Code Online (Sandbox Code Playgroud)

javascript css svg templates scale

4
推荐指数
1
解决办法
4720
查看次数

背景图像在iOS上无法正确缩放

问题是背景图像在iOS设备上没有正确缩放,它是一个响应式网站,至少在桌面浏览器上它甚至在非常小的分辨率下也可以扩展.但是当我在iPhone/iPad上测试它似乎不起作用那样.

该页面是http://litoplas.net16.net/como.html(它是会议和电子书的内部演示文稿,它不会是公共链接,我的客户希望他的代表使用iPad,这就是解决问题的原因这是非常重要的).

这是我正在使用背景图像的部分的CSS示例:

.corte {
background: url(../images/corte.jpg) no-repeat center center fixed;
background-size: cover;
padding-bottom: 30%;
Run Code Online (Sandbox Code Playgroud)

}

正如我所说,背景图像在桌面浏览器上可以很好地扩展...他们不会在iOs上做同样的事情!

先谢谢你们,我花了很多时间搜索并试图解决这个问题,希望你们能给我一些答案!:)

html css scale ipad ios

4
推荐指数
1
解决办法
4846
查看次数

Scale之后LinearLayout如何在左下角对齐?

我有LinearLayout,我缩放LinearLayout

ll.setScaleX(0.8f);
ll.setScaleY(0.8f);
Run Code Online (Sandbox Code Playgroud)

我想在Scale之后对齐左边的按钮.我怎么能做到这一点?

当我做:

Display mdisp = getWindowManager().getDefaultDisplay();
Point mdispSize = new Point();
mdisp.getSize(mdispSize);
maxX = mdispSize.x; 
maxY = mdispSize.y;
commonCardContainer.setX(0);
commonCardContainer.setY(maxY - commonCardContainer.getHeight());
Run Code Online (Sandbox Code Playgroud)

我有结果"后规模"(见图)

在此输入图像描述

android view scale

4
推荐指数
1
解决办法
701
查看次数

在r中的data.table缩放

       LC  RC TOEIC eua again  class
   1: 490 390   880  90     0 100818
   2: 495 395   890  90     0 100818
   3: 490 330   820  90     0 100818
   4: 495 460   955  96     0 100818
   5: 495 370   865  91     0 100818
  ---                               
1021: 470 400   870  61     0 100770
1022: 260 180   440  48     0 100770
1023: 345 190   535  39     0 100770
1024: 450 295   745  65     0 100770
1025: 395 230   625  79     0 100770
Run Code Online (Sandbox Code Playgroud)

这是名为"analy"的data.table

我想要缩放变量"LC","RC","TOEIC","eua"

我可以像这样扩展 …

r scale data.table

4
推荐指数
1
解决办法
3845
查看次数

背景图像上摇晃不稳的CSS缩放变换

我有一个背景图像,它有一个带有变换的父div:带有动画的缩放比例,当你登陆页面时,会给出背景图像慢慢放大的效果.

除了10/11之外,它在整个董事会中表现完美.我已经添加了所有正确的预修复,但仍然得到了一个非常不稳定和不稳定的动画.

我已经研究并应用了加速黑客,但没有给出任何东西.

有没有人有修复或看到过这些方面的东西?

谢谢!

css internet-explorer transform scale

4
推荐指数
2
解决办法
3237
查看次数

Swift:UIGraphicsBeginImageContextWithOptions比例因子设置为0但未应用

我曾经使用以下代码调整图像大小,并且它曾经在比例因子上工作得很好.现在使用Swift 3我无法弄清楚为什么不考虑比例因子.调整图像大小但未应用比例因子.你知道为什么吗?

let layer = self.imageview.layer

UIGraphicsBeginImageContextWithOptions(layer.bounds.size, true, 0)

layer.render(in: UIGraphicsGetCurrentContext()!)
let scaledImage = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()

print("SCALED IMAGE SIZE IS \(scaledImage!.size)")
print(scaledImage!.scale)
Run Code Online (Sandbox Code Playgroud)

例如,如果我在iPhone 5上截取屏幕截图,图像大小将为320*568.我以前用相同的代码得到640*1136 ..什么可能导致比例因子不被应用?

当我打印图像的比例时,它将根据设备分辨率打印1,2或3,但不会应用于从上下文拍摄的图像.

scale image-resizing ios uigraphicscontext swift

4
推荐指数
1
解决办法
4065
查看次数

如何使用MediaQuery为Flutter中的文本设置scaleFactor?

借助MediaQuery,我可以获得Samsung S7 Edge屏幕尺寸的高度和宽度,因此可以使用它。但是,如何使用MediaQuery在ListTile中布置多列动态文本呢?在我的演示项目中,我将文本大小设置为12,在Samsung S6中,我遇到了溢出问题... Flutter中文本比例因子的任何信息或示例?

我在这里找到了一个解决方案(Flutter如何处理dpi文本和图像大小的差异),我尝试构建演示项目。S6 textScaleFactor是1.1而S7是1.0 ....

我使用S7文本大小对其进行测试的原始演示应用程序为12。当我尝试在S6中对其进行测试时,我遇到了溢出问题...我需要使用MediaQuery缩小或放大以设置文本缩放系数,以便它可以工作大多数设备没有溢出问题?

在ListTile中,我有一列包含4行单独的文本,并且所有值都来自数据库。如果文本值太长,则在S6设备上会出现溢出问题。所以我的问题是如何使用MediaQuery为Flutter中的文本设置scaleFactor?

更新:

new ListTile(
    trailing: new Icon(Icons.chevron_right),
    onTap: () {

    },
    title: new Row(
      mainAxisAlignment: MainAxisAlignment.spaceBetween,
      children: <Widget>[
        new Text(
          ‘My Account Details:’,
          style: new TextStyle(
              fontSize: 14.0, fontWeight: FontWeight.bold, color: Colors.black),
          overflow: TextOverflow.fade,
        ),
      ],
    ),
    subtitle: new Column(
      children: <Widget>[
        new Row(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: <Widget>[
            new Text(‘Hello Flutter’,
              style: new TextStyle(
                  fontSize: 12.0, color: Colors.black54),
              overflow: TextOverflow.fade,
            ),

            new Text(’Today is **************’,
              style: new TextStyle(
                  fontSize: …
Run Code Online (Sandbox Code Playgroud)

text scale dart flutter

4
推荐指数
1
解决办法
2797
查看次数