【发布时间】:2011-02-14 09:16:52
【问题描述】:
我在缩放要插入的图像时遇到了一些问题。 我一定是做错了什么,因为无论我做什么,它都不会改变。 这是我目前拥有的代码,但它似乎不起作用。 无论我尝试什么值,图像都可以很好地插入,只是无法缩放。
我做错了什么明显的事情吗?人们做错了什么常见的事情? 我正在使用 C#,但我假设所有语言的语法都是相同的(或多或少)。
Image imgSpine = Image.GetInstance(strSpine);
imgSpine.ScaleAbsolute(2, 55);
SpineCell.Image = imgSpine;
SpineCell.Image.Border = Rectangle.NO_BORDER;
SpineCell.VerticalAlignment = Element.ALIGN_TOP;
SpineCell.HorizontalAlignment = Element.ALIGN_LEFT;
pTable.AddCell(SpineCell);
【问题讨论】:
-
SpineCell是什么类型?在您调用 ScaleAbsolute 之后,ScaledHeight和ScaledWidth是否有您期望的值?也许图像正在缩放,但它的拉伸以适合容器?
标签: c# image pdf itextsharp scaling