本文整理汇总了C#中ImagePartType类的典型用法代码示例。如果您正苦于以下问题:C# ImagePartType类的具体用法?C# ImagePartType怎么用?C# ImagePartType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ImagePartType类属于命名空间,在下文中一共展示了ImagePartType类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: AddBackgroundPicture
/// <summary>
/// Add a background picture to the currently selected worksheet given a picture's data in a byte array.
/// If there's an existing background picture, that will be deleted first.
/// </summary>
/// <param name="PictureByteData">The picture's data in a byte array.</param>
/// <param name="PictureType">The image type of the picture.</param>
public void AddBackgroundPicture(byte[] PictureByteData, ImagePartType PictureType)
{
// delete any background picture first
this.DeleteBackgroundPicture();
slws.BackgroundPictureDataIsInFile = false;
slws.BackgroundPictureByteData = new byte[PictureByteData.Length];
for (int i = 0; i < PictureByteData.Length; ++i)
{
slws.BackgroundPictureByteData[i] = PictureByteData[i];
}
slws.BackgroundPictureImagePartType = PictureType;
}
开发者ID:rahmatsyaparudin,项目名称:KP_Raport,代码行数:19,代码来源:WorksheetFunctions.cs
示例2: AddImagePart
/// <summary>
/// Adds a ImagePart to the WorksheetPart.
/// </summary>
/// <param name="partType">The part type of the ImagePart.</param>
/// <param name="id">The relationship id.</param>
/// <returns>The newly added part.</returns>
public ImagePart AddImagePart(ImagePartType partType, string id)
{
string contentType = ImagePartTypeInfo.GetContentType(partType);
string partExtension = ImagePartTypeInfo.GetTargetExtension(partType);
OpenXmlPackage.PartExtensionProvider.MakeSurePartExtensionExist(contentType, partExtension);
return AddImagePart(contentType, id);
}
开发者ID:RicardoLo,项目名称:Open-XML-SDK,代码行数:14,代码来源:package.cs
示例3: GetImageData
private static byte[] GetImageData(string imageFilePath, ref ImagePartType imagePartType, ref long imageWidthEMU, ref long imageHeightEMU)
{
byte[] imageFileBytes;
// Open a stream on the image file and read it's contents. The
// following code will generate an exception if an invalid file
// name is passed.
using (FileStream fsImageFile = File.OpenRead(imageFilePath))
{
imageFileBytes = new byte[fsImageFile.Length];
fsImageFile.Read(imageFileBytes, 0, imageFileBytes.Length);
Bitmap imageFile = new Bitmap(fsImageFile);
// Determine the format of the image file.
// This sample code supports working with the following types of image files:
//
// Bitmap (BMP)
// Graphics Interchange Format (GIF)
// Joint Photographic Experts Group (JPG, JPEG)
// Portable Network Graphics (PNG)
// Tagged Image File Format (TIFF)
if (imageFile.RawFormat.Guid == ImageFormat.Bmp.Guid)
imagePartType = ImagePartType.Bmp;
else if (imageFile.RawFormat.Guid == ImageFormat.Gif.Guid)
imagePartType = ImagePartType.Gif;
else if (imageFile.RawFormat.Guid == ImageFormat.Jpeg.Guid)
imagePartType = ImagePartType.Jpeg;
else if (imageFile.RawFormat.Guid == ImageFormat.Png.Guid)
imagePartType = ImagePartType.Png;
else if (imageFile.RawFormat.Guid == ImageFormat.Tiff.Guid)
imagePartType = ImagePartType.Tiff;
else
{
throw new ArgumentException("Unsupported image file format: " + imageFilePath);
}
if (imageFile.Width > 1024)
{
Size size = new Size(1024, (imageFile.Height * imageFile.Width) / 1024);
imageFile = Utils.ResizeImage(imageFile,size);
}
if (imageFile.Height > 768)
{
Size size = new Size((imageFile.Height * imageFile.Width) / 768, 768);
imageFile = Utils.ResizeImage(imageFile, size);
}
// Get the dimensions of the image in English Metric Units (EMU)
// for use when adding the markup for the image to the slide.
imageWidthEMU =
(long)((imageFile.Width / imageFile.HorizontalResolution) * 914400L);
imageHeightEMU =
(long)((imageFile.Height / imageFile.VerticalResolution) * 914400L);
}
return imageFileBytes;
}
开发者ID:cristianowa,项目名称:Visual-Studio-Projects,代码行数:61,代码来源:SlideShowCreator.cs
示例4: SLPicture
/// <summary>
/// Initializes an instance of SLPicture given a picture's data in a byte array, and the targeted computer's horizontal and vertical resolution. This scales the picture according to how it will be displayed on the targeted computer screen.
/// </summary>
/// <param name="PictureByteData">The picture's data in a byte array.</param>
/// <param name="PictureType">The image type of the picture.</param>
/// <param name="TargetHorizontalResolution">The targeted computer's horizontal resolution (DPI).</param>
/// <param name="TargetVerticalResolution">The targeted computer's vertical resolution (DPI).</param>
public SLPicture(byte[] PictureByteData, ImagePartType PictureType, float TargetHorizontalResolution, float TargetVerticalResolution)
{
InitialisePicture();
DataIsInFile = false;
this.PictureByteData = new byte[PictureByteData.Length];
for (int i = 0; i < PictureByteData.Length; ++i)
{
this.PictureByteData[i] = PictureByteData[i];
}
this.PictureImagePartType = PictureType;
SetResolution(true, TargetHorizontalResolution, TargetVerticalResolution);
}
开发者ID:rahmatsyaparudin,项目名称:KP_Raport,代码行数:21,代码来源:SLPicture.cs
示例5: InitialisePictureFile
private void InitialisePictureFile(string FileName)
{
this.PictureFileName = FileName.Trim();
this.PictureImagePartType = SLDrawingTool.GetImagePartType(this.PictureFileName);
string sImageFileName = this.PictureFileName.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar);
sImageFileName = sImageFileName.Substring(sImageFileName.LastIndexOf(Path.DirectorySeparatorChar) + 1);
this.sAlternativeText = sImageFileName;
}
开发者ID:rahmatsyaparudin,项目名称:KP_Raport,代码行数:10,代码来源:SLPicture.cs
示例6: InitialisePicture
private void InitialisePicture()
{
// should be true once we get *everyone* to stop using those confoundedly
// hard to understand EMUs and absolute positionings...
UseEasyPositioning = false;
TopPosition = 0;
LeftPosition = 0;
UseRelativePositioning = true;
AnchorRowIndex = 1;
AnchorColumnIndex = 1;
OffsetX = 0;
OffsetY = 0;
WidthInEMU = 0;
HeightInEMU = 0;
WidthInPixels = 0;
HeightInPixels = 0;
fHorizontalResolutionRatio = 1;
fVerticalResolutionRatio = 1;
this.bLockWithSheet = true;
this.bPrintWithSheet = true;
this.vCompressionState = A.BlipCompressionValues.Print;
this.decBrightness = 0;
this.decContrast = 0;
//this.decRotationAngle = 0;
this.ShapeProperties = new SLShapeProperties(new List<System.Drawing.Color>());
this.HasUri = false;
this.HyperlinkUri = string.Empty;
this.HyperlinkUriKind = UriKind.Absolute;
this.IsHyperlinkExternal = true;
this.DataIsInFile = true;
this.PictureFileName = string.Empty;
this.PictureByteData = new byte[1];
this.PictureImagePartType = ImagePartType.Bmp;
}
开发者ID:rahmatsyaparudin,项目名称:KP_Raport,代码行数:39,代码来源:SLPicture.cs
示例7: GetContentType
internal static string GetContentType(ImagePartType imageType)
{
switch (imageType)
{
case ImagePartType.Bmp:
return "image/bmp";
case ImagePartType.Gif:
return "image/gif";
case ImagePartType.Png:
return "image/png";
case ImagePartType.Tiff:
return "image/tiff";
//case ImagePartType.Xbm:
// return "image/xbm";
case ImagePartType.Icon:
return "image/x-icon";
case ImagePartType.Pcx:
return "image/x-pcx";
//case ImagePartType.Pcz:
// return "image/x-pcz";
//case ImagePartType.Pict:
// return "image/pict";
case ImagePartType.Jpeg:
return "image/jpeg";
case ImagePartType.Emf:
return "image/x-emf";
case ImagePartType.Wmf:
return "image/x-wmf";
default:
throw new ArgumentOutOfRangeException("imageType");
}
}
开发者ID:RicardoLo,项目名称:Open-XML-SDK,代码行数:44,代码来源:BinaryTypeEnums.cs
示例8: GetTargetExtension
internal static string GetTargetExtension(ImagePartType imageType)
{
switch (imageType)
{
case ImagePartType.Bmp:
return ".bmp";
case ImagePartType.Gif:
return ".gif";
case ImagePartType.Png:
return ".png";
case ImagePartType.Tiff:
return ".tiff";
//case ImagePartType.Xbm:
// return ".xbm";
case ImagePartType.Icon:
return ".ico";
case ImagePartType.Pcx:
return ".pcx";
//case ImagePartType.Pcz:
// return ".pcz";
//case ImagePartType.Pict:
// return ".pict";
case ImagePartType.Jpeg:
return ".jpg";
case ImagePartType.Emf:
return ".emf";
case ImagePartType.Wmf:
return ".wmf";
default:
return ".image";
}
}
开发者ID:RicardoLo,项目名称:Open-XML-SDK,代码行数:44,代码来源:BinaryTypeEnums.cs
示例9: InitialisePicture
//.........这里部分代码省略.........
//this.decRotationAngle = 0;
this.vPictureShape = A.ShapeTypeValues.Rectangle;
this.FillType = SLPictureFillType.None;
this.FillClassInnerXml = string.Empty;
this.HasOutline = false;
this.PictureOutline = new A.Outline();
this.HasOutlineFill = false;
this.PictureOutlineFill = new A.SolidFill();
this.HasGlow = false;
this.GlowRadius = 0;
this.GlowColorInnerXml = string.Empty;
this.HasInnerShadow = false;
this.PictureInnerShadow = new A.InnerShadow();
this.HasOuterShadow = false;
this.PictureOuterShadow = new A.OuterShadow();
this.HasReflection = false;
this.ReflectionBlurRadius = 0;
this.ReflectionStartOpacity = 100000;
this.ReflectionStartPosition = 0;
this.ReflectionEndAlpha = 0;
this.ReflectionEndPosition = 100000;
this.ReflectionDistance = 0;
this.ReflectionDirection = 0;
this.ReflectionFadeDirection = 5400000;
this.ReflectionHorizontalRatio = 100000;
this.ReflectionVerticalRatio = 100000;
this.ReflectionHorizontalSkew = 0;
this.ReflectionVerticalSkew = 0;
this.ReflectionAlignment = A.RectangleAlignmentValues.Bottom;
this.ReflectionRotateWithShape = true;
this.HasSoftEdge = false;
this.SoftEdgeRadius = 0;
this.HasScene3D = false;
this.CameraLatitude = 0;
this.CameraLongitude = 0;
this.CameraRevolution = 0;
this.CameraPreset = A.PresetCameraValues.OrthographicFront;
this.CameraFieldOfView = 0;
this.CameraZoom = 0;
this.LightRigLatitude = 0;
this.LightRigLongitude = 0;
this.LightRigRevolution = 0;
this.LightRigType = A.LightRigValues.ThreePoints;
this.LightRigDirection = A.LightRigDirectionValues.Top;
//this.HasBackdrop = false;
//this.BackdropAnchorX = 0;
//this.BackdropAnchorY = 0;
//this.BackdropAnchorZ = 0;
//this.BackdropNormalDx = 0;
//this.BackdropNormalDy = 0;
//this.BackdropNormalDz = 0;
//this.BackdropUpVectorDx = 0;
//this.BackdropUpVectorDy = 0;
//this.BackdropUpVectorDz = 0;
this.HasBevelTop = false;
this.BevelTopPreset = A.BevelPresetValues.Circle;
this.BevelTopWidth = 76200;
this.BevelTopHeight = 76200;
this.HasBevelBottom = false;
this.BevelBottomPreset = A.BevelPresetValues.Circle;
this.BevelBottomWidth = 76200;
this.BevelBottomHeight = 76200;
this.HasExtrusion = false;
this.ExtrusionHeight = 0;
this.ExtrusionColorInnerXml = string.Empty;
this.HasContour = false;
this.ContourWidth = 0;
this.ContourColorInnerXml = string.Empty;
this.HasMaterialType = false;
this.MaterialType = A.PresetMaterialTypeValues.WarmMatte;
this.HasZDistance = false;
this.ZDistance = 0;
this.HasUri = false;
this.HyperlinkUri = string.Empty;
this.HyperlinkUriKind = UriKind.Absolute;
this.IsHyperlinkExternal = true;
this.DataIsInFile = true;
this.PictureFileName = string.Empty;
this.PictureByteData = new byte[1];
this.PictureImagePartType = ImagePartType.Bmp;
}
开发者ID:mousetwentytwo,项目名称:test,代码行数:101,代码来源:SLPicture.cs
注:本文中的ImagePartType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论