本文整理汇总了C#中PictureType类的典型用法代码示例。如果您正苦于以下问题:C# PictureType类的具体用法?C# PictureType怎么用?C# PictureType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PictureType类属于命名空间,在下文中一共展示了PictureType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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();
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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";
}
示例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);
}
}