本文整理汇总了C#中Resolution类的典型用法代码示例。如果您正苦于以下问题:C# Resolution类的具体用法?C# Resolution怎么用?C# Resolution使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Resolution类属于命名空间,在下文中一共展示了Resolution类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Run
public static void Run()
{
// ExStart:AllPagesToTIFF
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_AsposePdf_Images();
// Open document
Document pdfDocument = new Document(dataDir+ "PageToTIFF.pdf");
// Create Resolution object
Resolution resolution = new Resolution(300);
// Create TiffSettings object
TiffSettings tiffSettings = new TiffSettings();
tiffSettings.Compression = CompressionType.None;
tiffSettings.Depth = ColorDepth.Default;
tiffSettings.Shape = ShapeType.Landscape;
tiffSettings.SkipBlankPages = false;
// Create TIFF device
TiffDevice tiffDevice = new TiffDevice(resolution, tiffSettings);
// Convert a particular page and save the image to stream
tiffDevice.Process(pdfDocument, dataDir + "AllPagesToTIFF_out.tif");
// ExEnd:AllPagesToTIFF
System.Console.WriteLine("PDF all pages converted to one tiff file successfully!");
}
示例2: HistoryRequest
/// <summary>
/// Initializes a new instance of the <see cref="HistoryRequest"/> class from the specified parameters
/// </summary>
/// <param name="startTimeUtc">The start time for this request,</param>
/// <param name="endTimeUtc">The start time for this request</param>
/// <param name="dataType">The data type of the output data</param>
/// <param name="symbol">The symbol to request data for</param>
/// <param name="securityType">The security type of the symbol</param>
/// <param name="resolution">The requested data resolution</param>
/// <param name="market">The market this data belongs to</param>
/// <param name="exchangeHours">The exchange hours used in fill forward processing</param>
/// <param name="fillForwardResolution">The requested fill forward resolution for this request</param>
/// <param name="includeExtendedMarketHours">True to include data from pre/post market hours</param>
/// <param name="isCustomData">True for custom user data, false for normal QC data</param>
public HistoryRequest(DateTime startTimeUtc,
DateTime endTimeUtc,
Type dataType,
Symbol symbol,
SecurityType securityType,
Resolution resolution,
string market,
SecurityExchangeHours exchangeHours,
Resolution? fillForwardResolution,
bool includeExtendedMarketHours,
bool isCustomData
)
{
StartTimeUtc = startTimeUtc;
EndTimeUtc = endTimeUtc;
Symbol = symbol;
ExchangeHours = exchangeHours;
Resolution = resolution;
FillForwardResolution = fillForwardResolution;
IncludeExtendedMarketHours = includeExtendedMarketHours;
DataType = dataType;
SecurityType = securityType;
Market = market;
IsCustomData = isCustomData;
TimeZone = exchangeHours.TimeZone;
}
示例3: Security
/********************************************************
* CONSTRUCTOR/DELEGATE DEFINITIONS
*********************************************************/
/// <summary>
/// Construct the Market Vehicle
/// </summary>
public Security(string symbol, SecurityType type, Resolution resolution, bool fillDataForward, decimal leverage, bool extendedMarketHours, bool useQuantConnectData = false)
{
//Set Basics:
this._symbol = symbol;
this._type = type;
this._resolution = resolution;
this._isFillDataForward = fillDataForward;
this._leverage = leverage;
this._isExtendedMarketHours = extendedMarketHours;
this._isQuantConnectData = useQuantConnectData;
//Setup Transaction Model for this Asset
switch (type)
{
case SecurityType.Equity:
Model = new EquityTransactionModel();
break;
case SecurityType.Forex:
Model = new ForexTransactionModel();
break;
case SecurityType.Base:
Model = new SecurityTransactionModel();
break;
}
//Holdings for new Vehicle:
Cache = new SecurityCache();
Holdings = new SecurityHolding(symbol, Model);
Exchange = new SecurityExchange();
}
示例4: SetResolution
private void SetResolution(Resolution hibResolution)
{
switch (hibResolution)
{
case Resolution.Year:
resolution = DateTools.Resolution.YEAR;
break;
case Resolution.Month:
resolution = DateTools.Resolution.MONTH;
break;
case Resolution.Day:
resolution = DateTools.Resolution.DAY;
break;
case Resolution.Hour:
resolution = DateTools.Resolution.HOUR;
break;
case Resolution.Minute:
resolution = DateTools.Resolution.MINUTE;
break;
case Resolution.Second:
resolution = DateTools.Resolution.SECOND;
break;
case Resolution.Millisecond:
resolution = DateTools.Resolution.MILLISECOND;
break;
default:
throw new AssertionFailure("Unknown Resolution: " + hibResolution);
}
}
示例5: CanAddSubscription
/// <summary>
/// Determines if we can add a subscription for the specified resolution
/// </summary>
/// <param name="resolution">The new subscription resolution to check</param>
/// <param name="reason">When this function returns false, this is the reason we are unable to add the subscription</param>
/// <returns>True if we can add a subscription for the specified resolution while
/// remaining within our limits, false if this will put us over our limits</returns>
public bool CanAddSubscription(Resolution resolution, out string reason)
{
reason = null;
var limit = GetResolutionLimit(resolution);
// we increment the resolution since we're about to add one
var count = GetResolutionCount(resolution) + 1;
// check max counts of symbols
if (count >= limit)
{
reason = GetCountLimitReason(resolution);
return false;
}
// check ram usage
var ramEstimate = GetRamEstimate(
GetResolutionCount(Resolution.Minute),
GetResolutionCount(Resolution.Second),
GetResolutionCount(Resolution.Tick)
);
// finally, check current estimate against the precomputed maximum
if (ramEstimate > _maxRamEstimate)
{
reason = GetMaxRamReason(ramEstimate);
return false;
}
return true;
}
示例6: ThreeInside
/// <summary>
/// Creates a new <see cref="Indicators.CandlestickPatterns.ThreeInside"/> pattern indicator.
/// The indicator will be automatically updated on the given resolution.
/// </summary>
/// <param name="symbol">The symbol whose pattern we seek</param>
/// <param name="resolution">The resolution.</param>
/// <param name="selector">Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar</param>
/// <returns>The pattern indicator for the requested symbol.</returns>
public ThreeInside ThreeInside(Symbol symbol, Resolution? resolution = null, Func<BaseData, TradeBar> selector = null)
{
var name = _algorithm.CreateIndicatorName(symbol, "THREEINSIDE", resolution);
var pattern = new ThreeInside(name);
_algorithm.RegisterIndicator(symbol, pattern, resolution, selector);
return pattern;
}
示例7: Update
public override CurrentMenu Update(GameTime gametime, Inputhandler inputhandler)
{
CurrentMenu menu = CurrentMenu.Options;
base.DoUpDownMovement(gametime, inputhandler);
if (inputhandler.GetNewPressedMenuKeys.Contains(MenuKeys.Left) || inputhandler.GetNewPressedMenuKeys.Contains(MenuKeys.Right))
{
int relative = inputhandler.GetNewPressedMenuKeys.Contains(MenuKeys.Left) ? -1 : 1;
switch (current_position)
{
case (int)OptionsMenuPositions.Resolution:
tempRes = Resolution.GetAvailableResolutions.GetRelativeElement(currentResPos, relative);
try
{
currentResPos = Resolution.GetAvailableResolutions.IndexOf(tempRes);
}
catch (Exception)
{
currentResPos = 0;
}
break;
case (int)OptionsMenuPositions.Shader_Quality:
options.QualitySettings[OptionsID.ShaderQuality] = options.QualitySettings[OptionsID.ShaderQuality].GetRelativeElement(relative);
break;
case (int)OptionsMenuPositions.Post_Process_Quality:
options.QualitySettings[OptionsID.PostProcessQuality] = options.QualitySettings[OptionsID.PostProcessQuality].GetRelativeElement(relative);
break;
case (int)OptionsMenuPositions.Particle_Quality:
options.QualitySettings[OptionsID.ParticleQuality] = options.QualitySettings[OptionsID.ParticleQuality].GetRelativeElement(relative);
break;
case (int)OptionsMenuPositions.Controller:
options.Controller = options.Controller.GetRelativeElement(relative);
break;
case (int)OptionsMenuPositions.Display_Mode:
tempDisplayMode = options.DisplayMode.GetRelativeElement(relative);
break;
case (int)OptionsMenuPositions.Music_Volume:
options.MusicVolume = options.MusicVolume + relative * 5;
break;
}
RecreateStrings();
}
if (inputhandler.GetNewPressedMenuKeys.Contains(MenuKeys.Back))
menu = CurrentMenu.MainMenu;
if (inputhandler.GetNewPressedMenuKeys.Contains(MenuKeys.Enter))
{
switch (current_position)
{
case (int)OptionsMenuPositions.Back:
menu = CurrentMenu.MainMenu;
break;
case (int)OptionsMenuPositions.Apply:
options.DisplayMode = tempDisplayMode;
options.Resolution = tempRes;
RecreateStrings();
break;
}
}
return menu;
}
示例8: Start
void Start()
{
instance = this;
// resolution
Resolution currentResolution = Screen.currentResolution;
if (Application.isEditor) {
screenResolution = Screen.resolutions [0];
} else {
screenResolution = currentResolution;
}
//set the resolution
Screen.SetResolution (screenResolution.width, screenResolution.height, true);
// UI Camera setup
UICamera = new GameObject ("UICamera");
UICamera.AddComponent<Camera>();
Camera uiCamera = UICamera.GetComponent<Camera>();
uiCamera.cullingMask = uiCameraLayerMask;
uiCamera.name = "UICamera";
uiCamera.orthographicSize = screenResolution.height / 2;
uiCamera.orthographic = true;
uiCamera.nearClipPlane = 0.3f;
uiCamera.farClipPlane = 50f;
uiCamera.clearFlags = CameraClearFlags.Depth;
uiCamera.depth = 1;
uiCamera.rect = new Rect (0, 0, 1, 1);
uiCamera.renderingPath = RenderingPath.UsePlayerSettings;
uiCamera.targetTexture = null;
uiCamera.hdr = false;
}
示例9: Convert
/// <summary>
/// Efetua a conversão do PDF em imagens
/// </summary>
/// <param name="pdfPath">Caminho do PDF</param>
/// <returns>Lista de caminhos das imagens por página</returns>
public List<string> Convert(string pdfPath)
{
List<string> imagePaths = new List<string>();
Document pdfDocument = new Document(pdfPath);
for (int pageCount = 1; pageCount <= pdfDocument.Pages.Count; pageCount++)
{
var imagePath = Path.Combine(Path.GetDirectoryName(pdfPath), "image" + pageCount + ".jpg");
using (FileStream imageStream = new FileStream(imagePath, FileMode.Create))
{
// Create Resolution object
Resolution resolution = new Resolution(300);
// Create JPEG device with specified attributes (Width, Height, Resolution, Quality)
// where Quality [0-100], 100 is Maximum
JpegDevice jpegDevice = new JpegDevice(resolution, 100);
// Convert a particular page and save the image to stream
jpegDevice.Process(pdfDocument.Pages[pageCount], imageStream);
// Close stream
imageStream.Close();
}
imagePaths.Add(imagePath);
}
return imagePaths;
}
示例10: SubscriptionDataConfig
/********************************************************
* CLASS CONSTRUCTOR
*********************************************************/
/// <summary>
/// Constructor for Data Subscriptions
/// </summary>
/// <param name="objectType">Type of the data objects.</param>
/// <param name="securityType">SecurityType Enum Set Equity/FOREX/Futures etc.</param>
/// <param name="symbol">Symbol of the asset we're requesting</param>
/// <param name="resolution">Resolution of the asset we're requesting</param>
/// <param name="fillForward">Fill in gaps with historical data</param>
/// <param name="extendedHours">Equities only - send in data from 4am - 8pm</param>
public SubscriptionDataConfig(Type objectType, SecurityType securityType = SecurityType.Equity, string symbol = "", Resolution resolution = Resolution.Minute, bool fillForward = true, bool extendedHours = false)
{
this.Type = objectType;
this.Security = securityType;
this.Resolution = resolution;
this.Symbol = symbol;
this.FillDataForward = fillForward;
this.ExtendedMarketHours = extendedHours;
this.PriceScaleFactor = 1;
this.MappedSymbol = symbol;
switch (resolution)
{
case Resolution.Tick:
Increment = TimeSpan.FromSeconds(0);
break;
case Resolution.Second:
Increment = TimeSpan.FromSeconds(1);
break;
default:
case Resolution.Minute:
Increment = TimeSpan.FromMinutes(1);
break;
case Resolution.Hour:
Increment = TimeSpan.FromHours(1);
break;
case Resolution.Daily:
Increment = TimeSpan.FromDays(1);
break;
}
}
示例11: Run
public static void Run()
{
// ExStart:ConvertToBMP
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_AsposePdf_Images();
// Open document
Document pdfDocument = new Document(dataDir + "AddImage.pdf");
for (int pageCount = 1; pageCount <= pdfDocument.Pages.Count; pageCount++)
{
using (FileStream imageStream = new FileStream("image" + pageCount + "_out" + ".bmp", FileMode.Create))
{
// Create Resolution object
Resolution resolution = new Resolution(300);
// Create BMP device with specified attributes
// Width, Height, Resolution, PageSize
BmpDevice bmpDevice = new BmpDevice(resolution);
// Convert a particular page and save the image to stream
bmpDevice.Process(pdfDocument.Pages[pageCount], imageStream);
// Close stream
imageStream.Close();
}
}
// ExEnd:ConvertToBMP
Console.WriteLine("\nPDF file converted to bmp successfully!");
}
示例12: Security
/********************************************************
* CONSTRUCTOR/DELEGATE DEFINITIONS
*********************************************************/
/// <summary>
/// Construct a new security vehicle based on the user options.
/// </summary>
public Security(string symbol, SecurityType type, Resolution resolution, bool fillDataForward, decimal leverage, bool extendedMarketHours, bool isDynamicallyLoadedData = false)
{
//Set Basics:
_symbol = symbol;
_type = type;
_resolution = resolution;
_isFillDataForward = fillDataForward;
_leverage = leverage;
_isExtendedMarketHours = extendedMarketHours;
_isDynamicallyLoadedData = isDynamicallyLoadedData;
//Setup Transaction Model for this Asset
switch (type)
{
case SecurityType.Equity:
Model = new EquityTransactionModel();
DataFilter = new EquityDataFilter();
break;
case SecurityType.Forex:
Model = new ForexTransactionModel();
DataFilter = new ForexDataFilter();
break;
case SecurityType.Base:
Model = new SecurityTransactionModel();
DataFilter = new SecurityDataFilter();
break;
}
//Holdings for new Vehicle:
Cache = new SecurityCache();
Holdings = new SecurityHolding(symbol, type, Model);
Exchange = new SecurityExchange();
}
示例13: InsertIntoList
public void InsertIntoList(ref Resolution[] VariableList, int Index, Resolution[] Target, out int ListCount)
{
List<Resolution> list = new List<Resolution>(VariableList);
if (Index < 0) {
Index = 0;
}
if (list.Count == 0) {
foreach (Resolution tmpVar in Target)
{
list.Add(tmpVar);
}
} else {
if (Index + 1 >= list.Count) {
foreach (Resolution tmpVar in Target)
{
list.Add(tmpVar);
}
} else {
foreach (Resolution tmpVar in Target)
{
list.Insert(Index, tmpVar);
}
}
}
VariableList = list.ToArray();
ListCount = VariableList.Length;
}
示例14: Run
public static void Run()
{
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_AsposePdf_Images();
//open document
Document pdfDocument = new Document(dataDir+ "ConvertAllPagesToEMF.pdf");
for (int pageCount = 1; pageCount <= pdfDocument.Pages.Count; pageCount++)
{
using (FileStream imageStream = new FileStream(dataDir + "image" + pageCount + ".emf", FileMode.Create))
{
//create Resolution object
Resolution resolution = new Resolution(300);
//create PNG device with specified attributes
//Width, Height, Resolution
EmfDevice emfDevice = new EmfDevice(500, 700, resolution);
//convert a particular page and save the image to stream
emfDevice.Process(pdfDocument.Pages[pageCount], imageStream);
//close stream
imageStream.Close();
}
}
}
示例15: CaptureManager
public CaptureManager(
Resolution resolution,
bool captureImages,
bool captureAudio,
bool captureVideo,
CameraType cameraType,
string movieRecordingDirectory,
int movieSegmentDurationInMilliSeconds,
bool breakMovieIntoSegments )
{
this.resolution = resolution;
this.captureImages = captureImages;
this.captureAudio = captureAudio;
this.captureVideo = captureVideo;
this.cameraType = cameraType;
this.movieSegmentDurationInMilliSeconds = movieSegmentDurationInMilliSeconds;
this.breakMovieIntoSegments = breakMovieIntoSegments;
if ( captureAudio || captureVideo )
{
this.movieRecordingDirectory = Path.Combine( movieRecordingDirectory, getDateTimeDirectoryName( DateTime.Now ) );
if ( Directory.Exists( this.movieRecordingDirectory ) == false )
{
Directory.CreateDirectory( this.movieRecordingDirectory );
}
}
}