コード例 #1
0
        protected override NWidget CreateExampleContent()
        {
            m_PathAngle     = 0;
            m_PathPositionX = 200;
            m_PathPositionY = 100;

            m_Stroke = new NStroke(1, NColor.Red);

            // create an image fill using an embedded image
            m_ImageFill = new NImageFill(NResources.Image_Artistic_Plane_png);

            // create a custom texture mapping and assign it to the image fill
            m_MyTextureMapping = new MyTextureMapping();
            m_MyTextureMapping.TextureAngle = 45;
            m_MyTextureMapping.PinPoint     = new NPoint(m_PathPositionX, m_PathPositionY);
            m_ImageFill.TextureMapping      = m_MyTextureMapping;

            m_Canvas = new NCanvas();
            m_Canvas.PreferredSize       = new NSize(800, 600);
            m_Canvas.BackgroundFill      = new NColorFill(new NColor(220, 220, 200));
            m_Canvas.HorizontalPlacement = ENHorizontalPlacement.Center;
            m_Canvas.VerticalPlacement   = ENVerticalPlacement.Center;
            m_Canvas.PrePaint           += new Function <NCanvasPaintEventArgs>(OnCanvasPrePaint);

            NScrollContent scroll = new NScrollContent();

            scroll.Content        = m_Canvas;
            scroll.NoScrollHAlign = ENNoScrollHAlign.Center;
            scroll.NoScrollVAlign = ENNoScrollVAlign.Center;
            return(scroll);
        }
コード例 #2
0
 public MyTextureCalibrator(MyTextureMapping textureMapping)
 {
     m_TextureMapping = textureMapping;
 }