ClassID.ClassID
内容
[
隐藏
]ClassID(byte[])
初始化一个新的实例ClassID
类.
public ClassID(byte[] classID)
范围 | 类型 | 描述 |
---|---|---|
classID | Byte[] | 作为字节系列的类 ID。 |
也可以看看
ClassID(byte[], bool)
初始化一个新的实例ClassID
类.
public ClassID(byte[] classID, bool isZeroLength)
范围 | 类型 | 描述 |
---|---|---|
classID | Byte[] | 作为字节系列的类 ID。 |
isZeroLength | Boolean | 如果设置为真的 [长度为零]. 记录的字符串长度为零但实际长度为四. |
例外
例外 | (健康)状况 |
---|---|
ArgumentNullException | 类 ID 为空。 |
也可以看看
ClassID(int)
初始化一个新的实例ClassID
类.
public ClassID(int classID)
范围 | 类型 | 描述 |
---|---|---|
classID | Int32 | 类 ID。 |
也可以看看
ClassID(uint)
初始化一个新的实例ClassID
类.
public ClassID(uint classID)
范围 | 类型 | 描述 |
---|---|---|
classID | UInt32 | 类 ID。 |
也可以看看
ClassID(string, bool)
初始化一个新的实例ClassID
类.
public ClassID(string classID, bool isZeroLength)
范围 | 类型 | 描述 |
---|---|---|
classID | String | ASCII 编码的类 ID。 |
isZeroLength | Boolean | 如果设置为真的 [长度为零]。 |
例子
此示例演示从图像导入的图层转换为智能对象图层并且保存的 PSD 文件是正确的。
[C#]
// 测试从图像导入的图层是否转换为智能对象图层以及保存的 PSD 文件是否正确。
string outputFilePath = outputFolder + Path.DirectorySeparatorChar + "layerTest2.psd";
string outputPngFilePath = Path.ChangeExtension(outputFilePath, ".png");
using (PsdImage image = (PsdImage)Image.Load(baseFolder + Path.DirectorySeparatorChar + "layerTest1.psd"))
{
string layerFilePath = baseFolder + Path.DirectorySeparatorChar + "picture.jpg";
using (var stream = new FileStream(layerFilePath, FileMode.Open))
{
Layer layer = null;
try
{
layer = new Layer(stream);
image.AddLayer(layer);
}
catch (Exception)
{
if (layer != null)
{
layer.Dispose();
}
throw;
}
var layer2 = image.Layers[2];
var layer3 = image.SmartObjectProvider.ConvertToSmartObject(image.Layers.Length - 1);
var bounds = layer3.Bounds;
layer3.Left = (image.Width - layer3.Width) / 2;
layer3.Top = layer2.Top;
layer3.Right = layer3.Left + bounds.Width;
layer3.Bottom = layer3.Top + bounds.Height;
image.Save(outputFilePath);
image.Save(outputPngFilePath, new PngOptions() { ColorType = PngColorType.TruecolorWithAlpha });
}
}
也可以看看
ClassID(string)
初始化一个新的实例ClassID
类.
public ClassID(string classID)
范围 | 类型 | 描述 |
---|---|---|
classID | String | ASCII 编码的类 ID。 |