本文整理汇总了C#中PictureType类的典型用法代码示例。如果您正苦于以下问题:C# PictureType类的具体用法?C# PictureType怎么用?C# PictureType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PictureType类属于命名空间,在下文中一共展示了PictureType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: GetImageDimension
/**
* Return the dimension of this image
*
* @param is the stream Containing the image data
* @param type type of the picture: {@link NPOI.SS.UserModel.Workbook#PICTURE_TYPE_JPEG},
* {@link NPOI.SS.UserModel.Workbook#PICTURE_TYPE_PNG} or {@link NPOI.SS.UserModel.Workbook#PICTURE_TYPE_DIB}
*
* @return image dimension in pixels
*/
public static Size GetImageDimension(Stream is1, PictureType type)
{
Size size = new Size();
if (type == PictureType.JPEG || type == PictureType.PNG || type == PictureType.DIB)
{
//we can calculate the preferred size only for JPEG, PNG and BMP
//other formats like WMF, EMF and PICT are not supported in Java
using (Image img = Image.FromStream(is1))
{
int[] dpi = GetResolution(img);
//if DPI is zero then assume standard 96 DPI
//since cannot divide by zero
if (dpi[0] == 0) dpi[0] = PIXEL_DPI;
if (dpi[1] == 0) dpi[1] = PIXEL_DPI;
size.Width = img.Width * PIXEL_DPI / dpi[0];
size.Height = img.Height * PIXEL_DPI / dpi[1];
return size;
}
}
else
logger.Log(POILogger.WARN, "Only JPEG, PNG and DIB pictures can be automatically sized");
return size;
}
开发者ID:twxstar,项目名称:npoi,代码行数:35,代码来源:ImageUtils.cs
示例2: Get
public static AttachedPictureFrame Get(TagLib.Id3v2.Tag tag, string description, PictureType type, bool create)
{
AttachedPictureFrame frame;
IEnumerator<Frame> enumerator = tag.GetFrames(FrameType.APIC).GetEnumerator();
try
{
while (enumerator.MoveNext())
{
Frame current = enumerator.Current;
frame = current as AttachedPictureFrame;
if (((frame != null) && ((description == null) || (frame.Description == description))) && ((type == PictureType.Other) || (frame.Type == type)))
{
return frame;
}
}
}
finally
{
if (enumerator == null)
{
}
enumerator.Dispose();
}
if (!create)
{
return null;
}
frame = new AttachedPictureFrame {
Description = description,
Type = type
};
tag.AddFrame(frame);
return frame;
}
开发者ID:shankithegreat,项目名称:commanderdotnet,代码行数:34,代码来源:AttachedPictureFrame.cs
示例3: GetLoggedEmployeeInfo
/// <summary>
/// <see cref="MyCompany.Visitors.Client.IEmployeeService"/>
/// </summary>
/// <param name="pictureType"><see cref="MyCompany.Visitors.Client.IEmployeeService"/></param>
/// <returns></returns>
public async Task<Employee> GetLoggedEmployeeInfo(PictureType pictureType)
{
string url = String.Format(CultureInfo.InvariantCulture
, "{0}api/employees/current/{1}", _urlPrefix, (int)pictureType);
return await base.GetAsync<Employee>(url);
}
开发者ID:stecenko,项目名称:MyCompany,代码行数:12,代码来源:EmployeeService.cs
示例4: Get
/// <summary>
/// <see cref="MyCompany.Visitors.Client.IEmployeeService"/>
/// </summary>
/// <param name="employeeId"><see cref="MyCompany.Visitors.Client.IEmployeeService"/></param>
/// <param name="pictureType"><see cref="MyCompany.Visitors.Client.IEmployeeService"/></param>
/// <returns></returns>
public async Task<Employee> Get(int employeeId, PictureType pictureType)
{
string url = String.Format(CultureInfo.InvariantCulture
, "{0}api/employees/{1}/{2}", _urlPrefix, employeeId, (int)pictureType);
return await base.GetAsync<Employee>(url);
}
开发者ID:stecenko,项目名称:MyCompany,代码行数:13,代码来源:EmployeeService.cs
示例5: Get
/// <summary>
/// <see cref="MyCompany.Visitors.Client.IVisitService"/>
/// </summary>
/// <param name="visitId"><see cref="MyCompany.Visitors.Client.IVisitService"/></param>
/// <param name="pictureType"><see cref="MyCompany.Visitors.Client.IVisitService"/></param>
/// <returns><see cref="MyCompany.Visitors.Client.IVisitService"/></returns>
public async Task<Visit> Get(int visitId, PictureType pictureType)
{
string url = String.Format(CultureInfo.InvariantCulture
, "{0}api/visits/{1}/{2}", _urlPrefix, visitId, (int)pictureType);
return await base.GetAsync<Visit>(url);
}
开发者ID:stecenko,项目名称:MyCompany,代码行数:13,代码来源:VisitService.cs
示例6: GetUserVisits
/// <summary>
/// <see cref="MyCompany.Visitors.Client.IVisitService"/>
/// </summary>
/// <param name="filter"><see cref="MyCompany.Visitors.Client.IVisitService"/></param>
/// <param name="pictureType"><see cref="MyCompany.Visitors.Client.IVisitService"/></param>
/// <param name="pageSize"><see cref="MyCompany.Visitors.Client.IVisitService"/></param>
/// <param name="pageCount"><see cref="MyCompany.Visitors.Client.IVisitService"/></param>
/// <param name="dateFilter"><see cref="MyCompany.Visitors.Client.IVisitService"/></param>
/// <returns><see cref="MyCompany.Visitors.Client.IVisitService"/></returns>
public async Task<IList<Visit>> GetUserVisits(string filter, PictureType pictureType, int pageSize, int pageCount, DateTime dateFilter)
{
string url = String.Format(CultureInfo.InvariantCulture
, "{0}api/visits/user?filter={1}&pictureType={2}&pageSize={3}&pageCount={4}&dateFilter={5}", _urlPrefix, filter, (int)pictureType, pageSize, pageCount, dateFilter);
return await base.GetAsync<IList<Visit>>(url);
}
开发者ID:stecenko,项目名称:MyCompany,代码行数:16,代码来源:VisitService.cs
示例7: Picture
public Picture(ByteVector data)
{
if (data == null)
{
throw new ArgumentNullException("data");
}
if (data.Count < 0x20)
{
throw new CorruptFileException("Data must be at least 32 bytes long");
}
int startIndex = 0;
this.type = (PictureType) data.Mid(startIndex, 4).ToUInt();
startIndex += 4;
int count = (int) data.Mid(startIndex, 4).ToUInt();
startIndex += 4;
this.mime_type = data.ToString(StringType.Latin1, startIndex, count);
startIndex += count;
int num3 = (int) data.Mid(startIndex, 4).ToUInt();
startIndex += 4;
this.description = data.ToString(StringType.UTF8, startIndex, num3);
startIndex += num3;
this.width = (int) data.Mid(startIndex, 4).ToUInt();
startIndex += 4;
this.height = (int) data.Mid(startIndex, 4).ToUInt();
startIndex += 4;
this.color_depth = (int) data.Mid(startIndex, 4).ToUInt();
startIndex += 4;
this.indexed_colors = (int) data.Mid(startIndex, 4).ToUInt();
startIndex += 4;
int length = (int) data.Mid(startIndex, 4).ToUInt();
startIndex += 4;
this.picture_data = data.Mid(startIndex, length);
}
开发者ID:shankithegreat,项目名称:commanderdotnet,代码行数:33,代码来源:Picture.cs
示例8: GetEmployees
/// <summary>
/// <see cref="MyCompany.Visitors.Client.IEmployeeService"/>
/// </summary>
/// <param name="filter"><see cref="MyCompany.Visitors.Client.IEmployeeService"/></param>
/// <param name="pictureType"><see cref="MyCompany.Visitors.Client.IEmployeeService"/></param>
/// <param name="pageSize"><see cref="MyCompany.Visitors.Client.IEmployeeService"/></param>
/// <param name="pageCount"><see cref="MyCompany.Visitors.Client.IEmployeeService"/></param>
/// <returns></returns>
public async Task<IList<Employee>> GetEmployees(string filter, PictureType pictureType, int pageSize, int pageCount)
{
string url = String.Format(CultureInfo.InvariantCulture
, "{0}api/employees/GetEmployees?filter={1}&pictureType={2}&pageSize={3}&pageCount={4}", _urlPrefix, filter, (int)pictureType, pageSize, pageCount);
return await base.GetAsync<IList<Employee>>(url);
}
开发者ID:stecenko,项目名称:MyCompany,代码行数:15,代码来源:EmployeeService.cs
示例9: Read
public override void Read(BitReader bitReader)
{
base.Read(bitReader);
PrimaryPicType = (PictureType)bitReader.GetByteFromNBits(3);
bitReader.DiscardTrailingBits(); // complete the byte
while (MoreRBSPData(bitReader))
bitReader.ReadByte();
}
开发者ID:ctapang,项目名称:GPUCyclops,代码行数:8,代码来源:MiscellaneousNALUs.cs
示例10: PictureFrame
public PictureFrame(byte[] raw_data, System.Drawing.Image image, string description, PictureType pictureType)
: this(image, description, pictureType)
{
if(raw_data==null)
{
throw new ArgumentNullException("The passed image raw data can not be null.");
}
this._rawData = raw_data;
}
开发者ID:sahands,项目名称:a-id3,代码行数:9,代码来源:PictureFrame.cs
示例11: PictureFrame
/// <summary>
/// Creates a new instance of PictureFrame.
/// </summary>
/// <param name="encoding">the text encoding</param>
/// <param name="mimeType">the MIME type</param>
/// <param name="description">the description</param>
/// <param name="picture">the picture type</param>
/// <param name="data">the picture bytes</param>
public PictureFrame(Encoding encoding, string mimeType, string description, PictureType picture, byte[] data)
{
Descriptor.ID = "APIC";
TextEncoding = encoding;
MimeType = mimeType;
Description = description;
PictureCoding = picture;
PictureData = data;
}
开发者ID:saitodisse,项目名称:id3tag.net,代码行数:17,代码来源:PictureFrame.cs
示例12: PictureFrame
/// <summary>
/// Creates a new instance of PictureFrame.
/// </summary>
/// <param name="encoding">the text encoding</param>
/// <param name="mimeType">the MIME type</param>
/// <param name="description">the description</param>
/// <param name="picture">the picture type</param>
/// <param name="data">the picture bytes</param>
public PictureFrame(TextEncodingType encoding, string mimeType, string description, PictureType picture,
byte[] data)
{
TextEncoding = encoding;
MimeType = mimeType;
Description = description;
PictureCoding = picture;
PictureData = data;
}
开发者ID:saitodisse,项目名称:id3tag.net,代码行数:17,代码来源:PictureFrame.cs
示例13: PictureFrame
/// <summary>
/// Creates a new instance of PictureFrame.
/// </summary>
/// <param name="encoding">the text encoding</param>
/// <param name="mimeType">the MIME type</param>
/// <param name="description">the description</param>
/// <param name="picture">the picture type</param>
/// <param name="data">the picture bytes</param>
public PictureFrame(Encoding encoding, string mimeType, string description, PictureType picture,
IList<byte> data)
{
Descriptor.Id = "APIC";
TextEncoding = encoding;
MimeType = mimeType;
Description = description;
PictureCoding = picture;
PictureData = new ReadOnlyCollection<byte>(data);
}
开发者ID:saitodisse,项目名称:id3tag.net,代码行数:18,代码来源:PictureFrame.cs
示例14: GetStringFromPictureType
public static string GetStringFromPictureType(PictureType pictureType)
{
foreach (KeyValuePair<string, PictureType> pair1 in PictureTypeHelper.m_PictureTypeDictionary)
{
if (((PictureType) pair1.Value) == pictureType)
{
return pair1.Key;
}
}
return "Other";
}
开发者ID:justwee,项目名称:WPF-Projects,代码行数:11,代码来源:PictureTypeHelper.cs
示例15: ParseImage
private void ParseImage(byte[] data, PictureName name, PictureType type)
{
Image img = Image.FromStream(new MemoryStream(data));
if (!_images.ContainsKey(name))
{
_images.Add(name, new Dictionary<PictureType, Image>());
}
if (_images[name].ContainsKey(type))
{
_images[name][type] = img;
}
else
{
_images[name].Add(type, img);
}
}
开发者ID:VISTALL,项目名称:game-updater,代码行数:17,代码来源:Language.cs
示例16: av_get_pict_type_char
public static extern char av_get_pict_type_char(PictureType pict_type);
开发者ID:NichUK,项目名称:ffmpeg-shard,代码行数:1,代码来源:AVCodec.cs
示例17: GetDefaultImageFileName
private string GetDefaultImageFileName(PictureType defaultPictureType = PictureType.Entity)
{
string defaultImageFileName;
switch (defaultPictureType)
{
case PictureType.Entity:
defaultImageFileName = _settingService.GetSettingByKey("Media.DefaultImageName", "default-image.jpg");
break;
case PictureType.Avatar:
defaultImageFileName = _settingService.GetSettingByKey("Media.Customer.DefaultAvatarImageName", "default-avatar.jpg");
break;
default:
defaultImageFileName = _settingService.GetSettingByKey("Media.DefaultImageName", "default-image.jpg");
break;
}
return defaultImageFileName;
}
开发者ID:toannguyen241994,项目名称:SmartStoreNET,代码行数:18,代码来源:PictureService.cs
示例18: GetPictureUrl
public virtual string GetPictureUrl(
Picture picture,
int targetSize = 0,
bool showDefaultPicture = true,
string storeLocation = null,
PictureType defaultPictureType = PictureType.Entity)
{
string url = string.Empty;
byte[] pictureBinary = null;
if (picture != null)
pictureBinary = LoadPictureBinary(picture);
if (picture == null || pictureBinary == null || pictureBinary.Length == 0)
{
if (showDefaultPicture)
{
url = GetDefaultPictureUrl(targetSize, defaultPictureType, storeLocation);
}
return url;
}
if (picture.IsNew)
{
_imageCache.DeleteCachedImages(picture);
// we do not validate picture binary here to ensure that no exception ("Parameter is not valid") will be thrown
picture = UpdatePicture(picture.Id,
pictureBinary,
picture.MimeType,
picture.SeoFilename,
false,
false);
}
url = this.GetProcessedImageUrl(
pictureBinary,
picture.Id,
picture.SeoFilename,
MimeTypes.MapMimeTypeToExtension(picture.MimeType),
targetSize,
storeLocation);
return url;
}
开发者ID:toannguyen241994,项目名称:SmartStoreNET,代码行数:43,代码来源:PictureService.cs
示例19: GetDefaultPictureUrl
public virtual string GetDefaultPictureUrl(int targetSize = 0, PictureType defaultPictureType = PictureType.Entity, string storeLocation = null)
{
string defaultImageFileName = GetDefaultImageFileName(defaultPictureType);
string filePath = GetDefaultPictureLocalPath(defaultImageFileName);
if (!File.Exists(filePath))
{
return string.Empty;
}
var url = this.GetProcessedImageUrl(
filePath,
0,
Path.GetFileNameWithoutExtension(filePath),
Path.GetExtension(filePath),
targetSize,
storeLocation);
return url;
}
开发者ID:toannguyen241994,项目名称:SmartStoreNET,代码行数:20,代码来源:PictureService.cs
示例20: AttachedPicture
public AttachedPicture()
{
_pictureType = PictureType.CoverFront;
}
开发者ID:Rashed-Hoque,项目名称:IdSharp,代码行数:4,代码来源:AttachedPicture.cs
注:本文中的PictureType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论