本文整理汇总了C#中Transformation.Generate方法的典型用法代码示例。如果您正苦于以下问题:C# Transformation.Generate方法的具体用法?C# Transformation.Generate怎么用?C# Transformation.Generate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Transformation
的用法示例。
在下文中一共展示了Transformation.Generate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestCreateTransform
public void TestCreateTransform()
{
// should allow creating named transformation
Transformation t = new Transformation().Crop("scale").Width(102);
CreateTransformParams create = new CreateTransformParams()
{
Name = "api_test_transformation",
Transform = t
};
m_cloudinary.CreateTransform(create);
GetTransformParams get = new GetTransformParams()
{
Transformation = create.Name
};
GetTransformResult getResult = m_cloudinary.GetTransform(get);
Assert.IsNotNull(getResult);
Assert.AreEqual(true, getResult.Strict);
Assert.AreEqual(false, getResult.Used);
Assert.AreEqual(1, getResult.Info.Length);
Assert.AreEqual(t.Generate(), new Transformation(getResult.Info[0]).Generate());
}
示例2: TestGetTransform
public void TestGetTransform()
{
// should allow getting transformation metadata
var t = new Transformation().Crop("scale").Dpr(1.3).Width(2.0);
var uploadParams = new ImageUploadParams()
{
File = new FileDescription(m_testImagePath),
EagerTransforms = new List<Transformation>() { t },
Tags = "transformation"
};
var uploadResult = m_cloudinary.Upload(uploadParams);
var result = m_cloudinary.GetTransform("c_scale,dpr_1.3,w_2.0");
Assert.IsNotNull(result);
Assert.AreEqual(t.Generate(), new Transformation(result.Info[0]).Generate());
}