使用 VBA 的 PowerPoint 幻灯片的度量单位是什么?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11251649/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What is the unit of measure for PowerPoint slides using VBA?
提问by rryanp
I am using VBA to paste charts/graphs from Access to PowerPoint. Once pasted, I am resizing them using VBA, but it does not allow me to use inches (even though when I do it manually through the shape Properties, the size values there are in inches).
我正在使用 VBA 将图表/图形从 Access 粘贴到 PowerPoint。粘贴后,我正在使用 VBA 调整它们的大小,但它不允许我使用英寸(即使当我通过形状属性手动执行此操作时,大小值以英寸为单位)。
My question is what unit of measure is the number I use in VBA? I assumed pixels and tried to convert using a 96 pixel per inch factor, but that wasn't just right. Now I'm curious about whether it's based on my screen resolution? I can quickly code it (through trial and error) to look good on my machine, but I worry then if somebody else runs it, and they have a different resolution, the slide will look different. (Note that the graphs are having to fit within other shapes.)
我的问题是我在 VBA 中使用的数字是什么计量单位?我假设像素并尝试使用每英寸 96 像素的系数进行转换,但这并不正确。现在我很好奇它是否基于我的屏幕分辨率?我可以快速编码它(通过反复试验)以在我的机器上看起来不错,但我担心如果其他人运行它,并且他们有不同的分辨率,幻灯片看起来会不同。(请注意,图形必须适合其他形状。)
If it's not based on screen resolution, does anybody know the dimensions of a slide in whatever unit it's in?
如果它不是基于屏幕分辨率,那么有人知道幻灯片的尺寸是什么单位吗?
回答by Tim Williams
Units in ppt VBA are Points (a point is about 1/72 of an inch)
ppt VBA中的单位是点(一个点大约是1/72英寸)
回答by Steve Rindsberg
Pardon the pedanticism, but an inch is exactly72 points, at least as far as PowerPoint and pretty much any digital system is concerned.
请原谅我的迂腐,但一英寸正好是72 点,至少就 PowerPoint 和几乎所有数字系统而言。
Before computers took over, "about" did indeed apply. All the more so because there were several different "standard" definitions of the point.
在计算机接管之前,“大约”确实适用。更是如此,因为对这一点有几种不同的“标准”定义。
http://en.wikipedia.org/wiki/Point_(typography)
http://en.wikipedia.org/wiki/Point_(排版)
AAMOF, at one ... er ... point, Microsoft redefined the cm (2.4 to the inch instead of 2.54) to suit its own purposes, leading to confusion when people in the metric climes precisely specified measurements in PowerPoint then found out that things didn't print at the expected size.
AAMOF,有一次……呃……,微软重新定义了厘米(2.4 英寸而不是 2.54 英寸)以适应自己的目的,当人们在公制气候中精确地在 PowerPoint 中指定测量值然后发现东西没有以预期的尺寸打印。
They fixed this in PPT 2002, but I'd be there are still files floating around that, when opened in current versions of the app, show odd page sizes.
他们在 PPT 2002 中修复了这个问题,但我认为仍然有文件在周围浮动,当在当前版本的应用程序中打开时,显示奇怪的页面大小。
回答by thenonhacker
On Windows, it's 96 pixels per inch.
在 Windows 上,它是每英寸 96 像素。
On Mac, it's 72 pixels per inch.
在 Mac 上,它是每英寸 72 像素。