示例#1
0
        SetBackgroundImage()
        {
            if (this.chkSetBackgroundImage.Checked)
            {
                String sAssemblyPath = Path.GetDirectoryName(
                    Assembly.GetExecutingAssembly().Location);

                WpfImageUtil oWpfImageUtil = new WpfImageUtil();

                BitmapSource oBitmapSource =
                    oWpfImageUtil.GetImageSynchronousIgnoreDpi(
                        Path.Combine(sAssemblyPath,
                                     "..\\..\\Images\\TestBackground.jpg"));

                m_oNodeXLControl.BackgroundImage = oBitmapSource;
            }
            else
            {
                m_oNodeXLControl.BackgroundImage = null;
            }
        }
示例#2
0
        SetBackgroundImage()
        {
            if (this.chkSetBackgroundImage.Checked)
            {
                String sAssemblyPath = Path.GetDirectoryName(
                    Assembly.GetExecutingAssembly().Location);

                WpfImageUtil oWpfImageUtil = new WpfImageUtil();

                BitmapSource oBitmapSource =
                    oWpfImageUtil.GetImageSynchronousIgnoreDpi(
                        Path.Combine(sAssemblyPath,
                                     "..\\..\\Images\\TestBackground.jpg"));

                m_oNodeXLControl.Graph.SetValue(
                    ReservedMetadataKeys.GraphBackgroundImage, oBitmapSource);
            }
            else
            {
                m_oNodeXLControl.Graph.RemoveKey(
                    ReservedMetadataKeys.GraphBackgroundImage);
            }
        }