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; } }
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); } }