コード例 #1
0
ファイル: SamplePointService.cs プロジェクト: holymoo/Litmus
        public SamplePoints GetSamplePoints(float screenPercentage)
        {
            var samplePoints = new SamplePoints();

            // Get the box sizing
            samplePoints.CenterBox = GetCenterBox(screenPercentage);

            // Get the sample points
            samplePoints.Points = GenerateSamplePoints(samplePoints.CenterBox);

            return samplePoints;
        }
コード例 #2
0
        /// <summary>
        /// Ctor
        /// </summary>
        public DirectxColorProvider()
        {
            _colorHelper = new ColorHelper();
            _samplePointService = new SamplePointService();

            PresentParameters present_params = new PresentParameters();
            if (d == null)
            {
                d = new Device(new Direct3D(), 0, DeviceType.Hardware, IntPtr.Zero, CreateFlags.SoftwareVertexProcessing, present_params);
            }
            if (_samplePoints == null)
            {
                _samplePoints = _samplePointService.GetSamplePoints(.1f);
            }

            if (_graphics == null)
            {
                _graphics = this.CreateGraphics();
            }
        }