penll
V2EX  ›  算法

支持图片缩放的二维装箱

  •  
  •   penll · Sep 1, 2021 · 1426 views
    This topic created in 1722 days ago, the information mentioned may be changed or developed.

    场景:当前页固定区域内多个图片,有序排列,且自动缩放,铺满固定区域,如果超出,则另起一页

    目前,找到的资料:固定大小的二维装箱 https://codeincomplete.com/articles/bin-packing/demo/

    但是,没办法支持图片缩放,进行合理的排版;

    是否把拍的照片,按固定区域的,1/2 比例或者 1/4 进行缩放,然后,继续按“codeincomplete”的方案进行装箱

    有没有大佬能帮忙解惑授业,有更好的方案

    Supplement 1  ·  Jun 23, 2022
    哦,自己实现了下。后面忘记放出来。
    现在补个链接: https://github.com/pen-ll/BinPacking
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3124 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 11:46 · PVG 19:46 · LAX 04:46 · JFK 07:46
    ♥ Do have faith in what you're doing.