小编ger*_*ick的帖子

将raphaeljs导出为jpg且路径背景为图像时出错

我的raphaeljs导出插件有问题(https://github.com/ElbertF/Raphael.Export).在路径元素中我使用属性fill作为源我给图像url填充.但是当我将它导出到SVG时,我看到了一个路径元素定义,但是当我将它导出到PNG时,我再也看不到了.

所以在我的应用程序中,我添加了一个attr这样的path元素:

paper.path("M 195 10 L 300  L 195 z").attr({'stroke-width': 0,'fill': 'url(images/alfen/02/murek.png)'});
Run Code Online (Sandbox Code Playgroud)

我用它导出 paper.toSVG()

在我的SVG中,我找到了一条路径:

<path transform="matrix(1,0,0,1,0,0)" fill="url(images/alfen/02/murek.png)" stroke="#000" d="M203,183.94389438943895L948,183.94389438943895L948,195L203,195Z" stroke-width="0"></path>
Run Code Online (Sandbox Code Playgroud)

但是当我将其转换为PNG时:

<?php 
    $json        = $_POST['json'];
    $output      = str_replace('\"','"',$json);
    $filenameSVG = 'test';

    file_put_contents("$filenameSVG.svg", $output);

    $konwert = "convert $filenameSVG.svg $filenameSVG.jpg";

    system($konwert);
Run Code Online (Sandbox Code Playgroud)

我无法找到满足我背景的这条道路.有人可以帮忙吗?

javascript php svg raphael

10
推荐指数
1
解决办法
1043
查看次数

使用ImageMagick命令行在现有图像上添加图像

我想使用imagemagick命令行向现有图像添加一系列图像.

如您所见,这不仅仅是添加图像.我找到了http://www.imagemagick.org/Usage/compose/我可以看到一些例子,但我需要的是填写每个'块'.

我有每个块开始和结束的确切位置,我也有一个缩放参数来缩小它.

我想我可以用

composite -geometry +31+105  toadd.gif source.gif  newfile.jpg
Run Code Online (Sandbox Code Playgroud)

但这只是添加了一个图像,我需要按比例缩小.

我想知道我是否可以创建某种矩形并用我的图像填充它们.

任何想法如何解决?

imagemagick

6
推荐指数
1
解决办法
9151
查看次数

使用jquery使用选定的列从html表创建json对象

我想知道如何解析 html 表以获取我可以使用 jquery 通过 $.post 发送的 json 对象。

我有一张桌子

<table id="Report">
 <thead>
  <tr>
   <th>Kod</th>
   <th>Nazwa</th>
   <th>Ilo??</th>
   <th>Netto / 1szt.</th>
   <th>Suma brutto</th>
  </tr>
 </thead>
<tbody>
 <tr>
  <td>00171 </td>
  <td>S?UP 50/1800 PO?REDNI(P) </td>
  <td>5</td><td>97.00 PLN </td>
  <td>394.31 PLN </td>
 </tr>
 <tr>
  <td>00172</td>
  <td>S?UP 50/1800 NARO?NY(P)</td>
  <td>1</td><td>97.00 PLN</td>
  <td>78.86 PLN</td>
 </tr>
 <tr>
  <td>00173 </td>
  <td>S?UP 50/1800 KO?COWY(P) </td>
  <td>1</td><td>97.00 PLN </td>
  <td>78.86 PLN</td>
 </tr>
</tbody>
<tfoot style="font-weight: bold;">    
 <tr>
  <th colspan="3" style="text-align: right;">Razem netto: 1955.85 PLN</th>
  <th colspan="2" style="text-align: right;">Razem brutto: 2405.69 …
Run Code Online (Sandbox Code Playgroud)

javascript jquery json

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

将嵌套的if语句转换为更优雅的开关?

我如何将这个嵌套的if语句转换为更具可读性和"优雅"的东西?

if(speed==0){
            othvalue=0;
        }else {
            if(speed>value1864cmn){
                othvalue=value1864cmn;
            }else {
                if(speed>value1746cmn){
                    othvalue=value1746cmn;
                }else {
                    if(speed>value1628cmn){
                        othvalue=value1628cmn;
                    }else {
                        if(speed>value1510cmn){
                            othvalue=value1510cmn;
                        }else {
                            if(speed>value1392cmn){
                                othvalue=value1392cmn;
                            }else {
                                if(speed>value1274cmn){
                                    othvalue=value1274cmn;
                                }else {
                                    if(speed>value1156cmn){
                                        othvalue=value1156cmn;
                                    }else {
                                        if(speed>value1038cmn){
                                            othvalue=value1038cmn;
                                        }else {
                                            if(speed>value920cmn){
                                                othvalue=value920cmn;
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        };
Run Code Online (Sandbox Code Playgroud)

javascript if-statement

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

prestashop - 通过api创建订单

我只是想知道这种情况是否可行:我们有一个用php/jscript编写的小型估算器应用程序,它提供了你需要建立围栏的产品列表.现在,我们正在开发我们的在线商店.我们决定使用prestashop.现在,我们希望能够直接从我们的估算器应用程序创建订单.我们想1)创建一个订单,2)将产品放入其中,3)重定向到结帐页面(即http://store.oursite.com/en/quick-order).有可能这样做吗?如果有,你能给我任何提示吗?谢谢

php prestashop

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

标签 统计

javascript ×3

php ×2

if-statement ×1

imagemagick ×1

jquery ×1

json ×1

prestashop ×1

raphael ×1

svg ×1