0
A
回答
0
所有包圍盒的rects面積
計算所有矩形的極值:
var currentLeftmostX=10000000;
var currentTopmostY=10000000;
var currentRightmostX=-10000000;
var currentBottommostY=-10000000;
// do this for each rect
if(rect.x < currentLeftmostX) {currentLeftmostX=rect.x;}
if(rect.y < currentTopmostY) {currentTopmostY=rect.y;}
if(rect.x+rect.width > currentRightmostX) {currentRightmostX=rect.x;}
if(rect.y+rect.height > currentBottommostY){currentBottommostY=rect.y;}
var boundingArea=
(currentRightmostX-currentLeftmostX)*(currentBottommostY - currentBottommostY);
相關問題
- 1. 從邊界計算區域
- 2. 在畫布上繪製區域
- 3. 爲什麼controlpaint繪製方法在客戶端繪畫區域之外繪製?
- 4. 在圖像上繪製正多邊形並計算區域
- 5. 在繪製到畫布之前計算文本的大小
- 6. Infoviz。在繪製之前計算樹的畫布大小
- 7. 在UITableViewCell的邊界之外繪圖
- 8. UWP畫布繪製出界
- 9. 計算多邊形區域
- 10. 計算GDI +繪圖的邊界框
- 11. 如何在UIView的邊界之外繪製陰影?
- 12. HTML5畫布繪製矩形 - 有差異寬度的邊界?
- 13. 更改計算爲適合邊界框的區域
- 14. 限制畫布中繪製圖像對象的區域HTML5
- 15. 繪製的UIView的邊界之外從的drawRect
- 16. 如何計算邊界框內繪製線條中的線寬
- 17. Java中多邊形的計算區域
- 18. HTML:如何計算佈局邊界
- 19. SVG沒有繪製在谷歌地圖可見區域之外
- 20. 圍繞畫布繪製邊框
- 21. 在組件的邊界外繪圖
- 22. 在android中繪製與畫布四分之一計?
- 23. 強制HTML畫布僅在某些圖形的某個區域上繪製
- 24. 正在尋找算法來尋找顏色區域的邊界
- 25. iOS:是否允許在邊界外繪畫
- 26. 如何計算繪製區域的面積?
- 27. 防止使用SurfaceView繪製畫布以外的畫布
- 28. 帆布聚合區域未被繪製
- 29. 計算在XAML中使用<ArcSegment>繪製的圓弧的邊界矩形
- 30. 如何使可能與子UIView繪製在父UIView邊界之外的交互?