A cubeis Composed of two squares andtwo parallelograms:
Sub DrawCube() ActiveSheet.Shapes.AddShape(msoShapeParallelogram, [b2].Left, [b2].Top, 4 * [b2].Width, 4 * [b2].Height).Fill.Transparency = 1 ActiveSheet.Shapes.AddShape(msoShapeParallelogram, [b12].Left, [b12].Top, 4 * [b2].Width, 4 * [b2].Height).Fill.Transparency = 1 ActiveSheet.Shapes.AddShape(msoShapeRectangle, [c2].Left, [c2].Top, 3 * [b2].Width, 10 * [b2].Height).Fill.Transparency = 1 ActiveSheet.Shapes.AddShape(msoShapeRectangle, [b6].Left, [b6].Top, 3 * [b2].Width, 10 * [b2].Height).Fill.Transparency = 1 End Sub
It returns:

Is it interesting?
本文介绍了一个使用VBA在Excel中绘制立方体的方法。通过添加平行四边形和矩形形状来构造立方体的各个面,实现了二维图形上的立体效果展现。
375

被折叠的 条评论
为什么被折叠?



