本文整理汇总了C#中ImageMagick.MagickImage.Flop方法的典型用法代码示例。如果您正苦于以下问题:C# MagickImage.Flop方法的具体用法?C# MagickImage.Flop怎么用?C# MagickImage.Flop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ImageMagick.MagickImage
的用法示例。
在下文中一共展示了MagickImage.Flop方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
public string Execute(FileItem item, string infile, string dest, ValuePairEnumerator configData)
{
var conf = new RotateTransformViewModel(configData);
// Read from file
using (MagickImage image = new MagickImage(infile))
{
image.BackgroundColor = new MagickColor(Color.Black);
if (conf.AutoRotate)
{
ExifProfile profile = image.GetExifProfile();
image.AutoOrient();
profile.SetValue(ExifTag.Orientation, (UInt16)0);
}
if (conf.Angle > 0)
image.Rotate(conf.Angle);
if(conf.FlipHorizontal)
image.Flop();
if (conf.FlipVertical)
image.Flip();
image.Format = MagickFormat.Jpeg;
// Save the result
image.Write(dest);
}
return dest;
}
示例2: ExecuteFlop
private static void ExecuteFlop(MagickImage image)
{
image.Flop();
}
示例3: Draw
public MagickImage Draw()
{
MainForm.ProgressStart("Rendering background ...");
// Check which terrain file is used
string texMpk = string.Format("{0}\\tex{1}.mpk", this.textureZoneDataDirectory, this.textureZoneId);
string lodMpk = string.Format("{0}\\lod{1}.mpk", this.textureZoneDataDirectory, this.textureZoneId);
// Get the tile dimension
double tileWidth = 512.0;
string tileTemplate = "";
MPAK mpak = new MPAK();
if (File.Exists(texMpk))
{
mpak.Load(texMpk);
if (mpak.Files.Where(f => f.Name.ToLower() == "tex00-00.dds").Count() > 0)
{
tileTemplate += "tex0{0}-0{1}.dds";
tileWidth = 512.0;
}
}
if (string.IsNullOrEmpty(tileTemplate))
{
mpak.Load(lodMpk);
if (mpak.Files.Where(f => f.Name.ToLower() == "lod00-00.dds").Count() > 0)
{
tileTemplate += "lod0{0}-0{1}.dds";
tileWidth = 256.0;
}
}
if (string.IsNullOrEmpty(tileTemplate))
{
MainForm.Log(string.Format("Zone {0}: No background textures found!", zoneConfiguration.ZoneId), MainForm.LogLevel.error);
return null;
}
// original size
double orginalWidth = tileWidth * 8;
double resizeFactor = (double)zoneConfiguration.TargetMapSize / (double)orginalWidth; // 0 - 1
MagickImage map = new MagickImage(Color.Transparent, zoneConfiguration.TargetMapSize, zoneConfiguration.TargetMapSize);
int lastWidth = 0;
int x = 0;
for (int col = 0; col <= 7; col++)
{
int y = 0;
for (int row = 0; row <= 7; row++)
{
string filename = string.Format(tileTemplate, col, row);
using (MagickImage mapTile = new MagickImage(mpak.GetFile(filename).Data))
{
int newSize = Convert.ToInt32(mapTile.Width * resizeFactor);
mapTile.Resize(newSize, newSize);
map.Composite(mapTile, x, y, CompositeOperator.SrcOver);
// Calculate new y
y += mapTile.Height;
lastWidth = mapTile.Height;
}
}
x += lastWidth;
int percent = 100 * col / 8;
MainForm.ProgressUpdate(percent);
}
MainForm.ProgressStartMarquee("Merging ...");
// Remove rounding fails
map.Trim();
// Flip if set
if (this.flipX) map.Flop();
if (this.flipY) map.Flip();
// Sharpen (tested a lot, seems to be the best values)
map.Sharpen(4, 3);
MainForm.ProgressReset();
return map;
}
示例4: Test_Stereo
public void Test_Stereo()
{
using (MagickImage image = new MagickImage(Files.Builtin.Logo))
{
image.Flop();
using (MagickImage rightImage = new MagickImage(Files.Builtin.Logo))
{
image.Stereo(rightImage);
ColorAssert.AreEqual(new MagickColor("#2222ffffffff"), image, 250, 375);
ColorAssert.AreEqual(new MagickColor("#ffff3e3e9292"), image, 380, 375);
}
}
}