diff --git a/README.md b/README.md
index 0f9c4d5..cec859b 100644
--- a/README.md
+++ b/README.md
@@ -1,2 +1,88 @@
-# How-to-Export-Chart-as-Image-in-WinUI-Chart
-How to Export Chart as Image in WinUI Chart
+# How to Export Chart as Image in WinUI Chart
+This article provides a detailed walkthrough on how to export a [WinUI Cartesian Chart](https://www.syncfusion.com/winui-controls/cartesian-charts) as an image. You can export the chart view in your desired file format, with supported formats being **JPEG** and **PNG.**
+
+### Initialize SfCartesianChart:
+
+Set up the **SfCartesianChart** following the [ Syncfusion WinUI Cartesian Chart documentation.](https://help.syncfusion.com/winui/cartesian-charts/getting-started)
+ ```xml
+
+
+ ....
+
+
+
+
+
+
+
+
+
+ ```
+
+### Export the Chart as an Image:
+
+ ```csharp
+private async void Button_Click(object sender, RoutedEventArgs e)
+ {
+ await SaveAsImageAsync(Chart, "chart.png");
+ }
+
+ private async Task SaveAsImageAsync(SfCartesianChart chart, string fileName)
+ {
+ if (chart == null)
+ return;
+
+ // Render the chart to a RenderTargetBitmap
+ var renderTargetBitmap = new RenderTargetBitmap();
+ await renderTargetBitmap.RenderAsync(chart);
+
+ // Get pixel data
+ var pixelBuffer = await renderTargetBitmap.GetPixelsAsync();
+ var pixels = pixelBuffer.ToArray();
+
+ // Determine file format and encoder
+ string extension = Path.GetExtension(fileName)?.ToLower() ?? ".png";
+ var encoderId = extension == ".jpg" || extension == ".jpeg"
+ ? BitmapEncoder.JpegEncoderId
+ : BitmapEncoder.PngEncoderId;
+
+ // Choose image save path
+ var folder = await Windows.Storage.StorageFolder.GetFolderFromPathAsync(@"D:\");
+ var picturesFolder = await folder.CreateFileAsync( fileName, Windows.Storage.CreationCollisionOption.ReplaceExisting);
+
+ // Encode the image
+ using (var stream = await picturesFolder.OpenAsync(FileAccessMode.ReadWrite))
+ {
+ var encoder = await BitmapEncoder.CreateAsync(encoderId, stream);
+
+ encoder.SetPixelData(
+ BitmapPixelFormat.Bgra8,
+ BitmapAlphaMode.Premultiplied,
+ (uint)renderTargetBitmap.PixelWidth,
+ (uint)renderTargetBitmap.PixelHeight,
+ 96.0, // DPI X
+ 96.0, // DPI Y
+ pixels);
+
+ await encoder.FlushAsync();
+ }
+ }
+ ```
+
+**Note:** By default, the chart background is transparent. When using JPEG format, RenderTargetBitmap converts the transparent background to black. To resolve this, set the chart’s BackgroundColor to white or any preferred color.
+
+**Chart output**
+
+ 
+
+**Exported Chart Image**
+
+ 
+
+### KB link
+For a more detailed, refer to the [Export Chart View as Image KB.](https://support.syncfusion.com/agent/kb/18644)
+
diff --git a/WinUISampleDemo/WinUISampleDemo.sln b/WinUISampleDemo/WinUISampleDemo.sln
new file mode 100644
index 0000000..e4c30dc
--- /dev/null
+++ b/WinUISampleDemo/WinUISampleDemo.sln
@@ -0,0 +1,40 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.12.35506.116 d17.12
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinUISampleDemo", "WinUISampleDemo\WinUISampleDemo.csproj", "{0C10A7EF-1D8E-48E0-A15A-D865C3FA5F58}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|ARM64 = Debug|ARM64
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|ARM64 = Release|ARM64
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {0C10A7EF-1D8E-48E0-A15A-D865C3FA5F58}.Debug|ARM64.ActiveCfg = Debug|ARM64
+ {0C10A7EF-1D8E-48E0-A15A-D865C3FA5F58}.Debug|ARM64.Build.0 = Debug|ARM64
+ {0C10A7EF-1D8E-48E0-A15A-D865C3FA5F58}.Debug|ARM64.Deploy.0 = Debug|ARM64
+ {0C10A7EF-1D8E-48E0-A15A-D865C3FA5F58}.Debug|x64.ActiveCfg = Debug|x64
+ {0C10A7EF-1D8E-48E0-A15A-D865C3FA5F58}.Debug|x64.Build.0 = Debug|x64
+ {0C10A7EF-1D8E-48E0-A15A-D865C3FA5F58}.Debug|x64.Deploy.0 = Debug|x64
+ {0C10A7EF-1D8E-48E0-A15A-D865C3FA5F58}.Debug|x86.ActiveCfg = Debug|x86
+ {0C10A7EF-1D8E-48E0-A15A-D865C3FA5F58}.Debug|x86.Build.0 = Debug|x86
+ {0C10A7EF-1D8E-48E0-A15A-D865C3FA5F58}.Debug|x86.Deploy.0 = Debug|x86
+ {0C10A7EF-1D8E-48E0-A15A-D865C3FA5F58}.Release|ARM64.ActiveCfg = Release|ARM64
+ {0C10A7EF-1D8E-48E0-A15A-D865C3FA5F58}.Release|ARM64.Build.0 = Release|ARM64
+ {0C10A7EF-1D8E-48E0-A15A-D865C3FA5F58}.Release|ARM64.Deploy.0 = Release|ARM64
+ {0C10A7EF-1D8E-48E0-A15A-D865C3FA5F58}.Release|x64.ActiveCfg = Release|x64
+ {0C10A7EF-1D8E-48E0-A15A-D865C3FA5F58}.Release|x64.Build.0 = Release|x64
+ {0C10A7EF-1D8E-48E0-A15A-D865C3FA5F58}.Release|x64.Deploy.0 = Release|x64
+ {0C10A7EF-1D8E-48E0-A15A-D865C3FA5F58}.Release|x86.ActiveCfg = Release|x86
+ {0C10A7EF-1D8E-48E0-A15A-D865C3FA5F58}.Release|x86.Build.0 = Release|x86
+ {0C10A7EF-1D8E-48E0-A15A-D865C3FA5F58}.Release|x86.Deploy.0 = Release|x86
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/WinUISampleDemo/WinUISampleDemo/App.xaml b/WinUISampleDemo/WinUISampleDemo/App.xaml
new file mode 100644
index 0000000..1992c70
--- /dev/null
+++ b/WinUISampleDemo/WinUISampleDemo/App.xaml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WinUISampleDemo/WinUISampleDemo/App.xaml.cs b/WinUISampleDemo/WinUISampleDemo/App.xaml.cs
new file mode 100644
index 0000000..b6d1f9f
--- /dev/null
+++ b/WinUISampleDemo/WinUISampleDemo/App.xaml.cs
@@ -0,0 +1,50 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Runtime.InteropServices.WindowsRuntime;
+using Microsoft.UI.Xaml;
+using Microsoft.UI.Xaml.Controls;
+using Microsoft.UI.Xaml.Controls.Primitives;
+using Microsoft.UI.Xaml.Data;
+using Microsoft.UI.Xaml.Input;
+using Microsoft.UI.Xaml.Media;
+using Microsoft.UI.Xaml.Navigation;
+using Microsoft.UI.Xaml.Shapes;
+using Windows.ApplicationModel;
+using Windows.ApplicationModel.Activation;
+using Windows.Foundation;
+using Windows.Foundation.Collections;
+
+// To learn more about WinUI, the WinUI project structure,
+// and more about our project templates, see: http://aka.ms/winui-project-info.
+
+namespace WinUISampleDemo
+{
+ ///
+ /// Provides application-specific behavior to supplement the default Application class.
+ ///
+ public partial class App : Application
+ {
+ ///
+ /// Initializes the singleton application object. This is the first line of authored code
+ /// executed, and as such is the logical equivalent of main() or WinMain().
+ ///
+ public App()
+ {
+ this.InitializeComponent();
+ }
+
+ ///
+ /// Invoked when the application is launched.
+ ///
+ /// Details about the launch request and process.
+ protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args)
+ {
+ m_window = new MainWindow();
+ m_window.Activate();
+ }
+
+ private Window? m_window;
+ }
+}
diff --git a/WinUISampleDemo/WinUISampleDemo/Assets/LockScreenLogo.scale-200.png b/WinUISampleDemo/WinUISampleDemo/Assets/LockScreenLogo.scale-200.png
new file mode 100644
index 0000000..7440f0d
Binary files /dev/null and b/WinUISampleDemo/WinUISampleDemo/Assets/LockScreenLogo.scale-200.png differ
diff --git a/WinUISampleDemo/WinUISampleDemo/Assets/SplashScreen.scale-200.png b/WinUISampleDemo/WinUISampleDemo/Assets/SplashScreen.scale-200.png
new file mode 100644
index 0000000..32f486a
Binary files /dev/null and b/WinUISampleDemo/WinUISampleDemo/Assets/SplashScreen.scale-200.png differ
diff --git a/WinUISampleDemo/WinUISampleDemo/Assets/Square150x150Logo.scale-200.png b/WinUISampleDemo/WinUISampleDemo/Assets/Square150x150Logo.scale-200.png
new file mode 100644
index 0000000..53ee377
Binary files /dev/null and b/WinUISampleDemo/WinUISampleDemo/Assets/Square150x150Logo.scale-200.png differ
diff --git a/WinUISampleDemo/WinUISampleDemo/Assets/Square44x44Logo.scale-200.png b/WinUISampleDemo/WinUISampleDemo/Assets/Square44x44Logo.scale-200.png
new file mode 100644
index 0000000..f713bba
Binary files /dev/null and b/WinUISampleDemo/WinUISampleDemo/Assets/Square44x44Logo.scale-200.png differ
diff --git a/WinUISampleDemo/WinUISampleDemo/Assets/Square44x44Logo.targetsize-24_altform-unplated.png b/WinUISampleDemo/WinUISampleDemo/Assets/Square44x44Logo.targetsize-24_altform-unplated.png
new file mode 100644
index 0000000..dc9f5be
Binary files /dev/null and b/WinUISampleDemo/WinUISampleDemo/Assets/Square44x44Logo.targetsize-24_altform-unplated.png differ
diff --git a/WinUISampleDemo/WinUISampleDemo/Assets/StoreLogo.png b/WinUISampleDemo/WinUISampleDemo/Assets/StoreLogo.png
new file mode 100644
index 0000000..a4586f2
Binary files /dev/null and b/WinUISampleDemo/WinUISampleDemo/Assets/StoreLogo.png differ
diff --git a/WinUISampleDemo/WinUISampleDemo/Assets/Wide310x150Logo.scale-200.png b/WinUISampleDemo/WinUISampleDemo/Assets/Wide310x150Logo.scale-200.png
new file mode 100644
index 0000000..8b4a5d0
Binary files /dev/null and b/WinUISampleDemo/WinUISampleDemo/Assets/Wide310x150Logo.scale-200.png differ
diff --git a/WinUISampleDemo/WinUISampleDemo/MainWindow.xaml b/WinUISampleDemo/WinUISampleDemo/MainWindow.xaml
new file mode 100644
index 0000000..405b96a
--- /dev/null
+++ b/WinUISampleDemo/WinUISampleDemo/MainWindow.xaml
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WinUISampleDemo/WinUISampleDemo/MainWindow.xaml.cs b/WinUISampleDemo/WinUISampleDemo/MainWindow.xaml.cs
new file mode 100644
index 0000000..247e658
--- /dev/null
+++ b/WinUISampleDemo/WinUISampleDemo/MainWindow.xaml.cs
@@ -0,0 +1,87 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Runtime.InteropServices.WindowsRuntime;
+using System.Threading.Tasks;
+
+using Microsoft.UI;
+using Microsoft.UI.Xaml;
+using Microsoft.UI.Xaml.Controls;
+using Microsoft.UI.Xaml.Controls.Primitives;
+using Microsoft.UI.Xaml.Data;
+using Microsoft.UI.Xaml.Input;
+using Microsoft.UI.Xaml.Media;
+using Microsoft.UI.Xaml.Media.Imaging;
+using Microsoft.UI.Xaml.Navigation;
+
+using Syncfusion.UI.Xaml.Charts;
+
+using Windows.Foundation;
+using Windows.Foundation.Collections;
+using Windows.Graphics.Imaging;
+using Windows.Storage;
+
+// To learn more about WinUI, the WinUI project structure,
+// and more about our project templates, see: http://aka.ms/winui-project-info.
+
+namespace WinUISampleDemo
+{
+ ///
+ /// An empty window that can be used on its own or navigated to within a Frame.
+ ///
+ public sealed partial class MainWindow : Window
+ {
+ public MainWindow()
+ {
+ this.InitializeComponent();
+ }
+
+ private async void Button_Click(object sender, RoutedEventArgs e)
+ {
+ await SaveAsImageAsync(Chart, "chart.png");
+ }
+
+ private async Task SaveAsImageAsync(SfCartesianChart chart, string fileName)
+ {
+ if (chart == null)
+ return;
+
+ // Render the chart to a RenderTargetBitmap
+ var renderTargetBitmap = new RenderTargetBitmap();
+ await renderTargetBitmap.RenderAsync(chart);
+
+ // Get pixel data
+ var pixelBuffer = await renderTargetBitmap.GetPixelsAsync();
+ var pixels = pixelBuffer.ToArray();
+
+ // Determine file format and encoder
+ string extension = Path.GetExtension(fileName)?.ToLower() ?? ".png";
+ var encoderId = extension == ".jpg" || extension == ".jpeg"
+ ? BitmapEncoder.JpegEncoderId
+ : BitmapEncoder.PngEncoderId;
+
+ // Choose image save path
+ var folder = await Windows.Storage.StorageFolder.GetFolderFromPathAsync(@"D:\");
+ var picturesFolder = await folder.CreateFileAsync( fileName, Windows.Storage.CreationCollisionOption.ReplaceExisting);
+
+
+ // Encode the image
+ using (var stream = await picturesFolder.OpenAsync(FileAccessMode.ReadWrite))
+ {
+ var encoder = await BitmapEncoder.CreateAsync(encoderId, stream);
+
+ encoder.SetPixelData(
+ BitmapPixelFormat.Bgra8,
+ BitmapAlphaMode.Premultiplied,
+ (uint)renderTargetBitmap.PixelWidth,
+ (uint)renderTargetBitmap.PixelHeight,
+ 96.0, // DPI X
+ 96.0, // DPI Y
+ pixels);
+
+ await encoder.FlushAsync();
+ }
+ }
+ }
+}
diff --git a/WinUISampleDemo/WinUISampleDemo/Package.appxmanifest b/WinUISampleDemo/WinUISampleDemo/Package.appxmanifest
new file mode 100644
index 0000000..0bd4049
--- /dev/null
+++ b/WinUISampleDemo/WinUISampleDemo/Package.appxmanifest
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
+
+ WinUISampleDemo
+ SowndharyaSelladurai
+ Assets\StoreLogo.png
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WinUISampleDemo/WinUISampleDemo/Properties/PublishProfiles/win-arm64.pubxml b/WinUISampleDemo/WinUISampleDemo/Properties/PublishProfiles/win-arm64.pubxml
new file mode 100644
index 0000000..8953cce
--- /dev/null
+++ b/WinUISampleDemo/WinUISampleDemo/Properties/PublishProfiles/win-arm64.pubxml
@@ -0,0 +1,14 @@
+
+
+
+
+ FileSystem
+ ARM64
+ win-arm64
+ bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\
+ true
+ False
+
+
\ No newline at end of file
diff --git a/WinUISampleDemo/WinUISampleDemo/Properties/PublishProfiles/win-x64.pubxml b/WinUISampleDemo/WinUISampleDemo/Properties/PublishProfiles/win-x64.pubxml
new file mode 100644
index 0000000..cd99561
--- /dev/null
+++ b/WinUISampleDemo/WinUISampleDemo/Properties/PublishProfiles/win-x64.pubxml
@@ -0,0 +1,14 @@
+
+
+
+
+ FileSystem
+ x64
+ win-x64
+ bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\
+ true
+ False
+
+
\ No newline at end of file
diff --git a/WinUISampleDemo/WinUISampleDemo/Properties/PublishProfiles/win-x86.pubxml b/WinUISampleDemo/WinUISampleDemo/Properties/PublishProfiles/win-x86.pubxml
new file mode 100644
index 0000000..a70c694
--- /dev/null
+++ b/WinUISampleDemo/WinUISampleDemo/Properties/PublishProfiles/win-x86.pubxml
@@ -0,0 +1,14 @@
+
+
+
+
+ FileSystem
+ x86
+ win-x86
+ bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\
+ true
+ False
+
+
\ No newline at end of file
diff --git a/WinUISampleDemo/WinUISampleDemo/Properties/launchSettings.json b/WinUISampleDemo/WinUISampleDemo/Properties/launchSettings.json
new file mode 100644
index 0000000..057db2b
--- /dev/null
+++ b/WinUISampleDemo/WinUISampleDemo/Properties/launchSettings.json
@@ -0,0 +1,10 @@
+{
+ "profiles": {
+ "WinUISampleDemo (Package)": {
+ "commandName": "MsixPackage"
+ },
+ "WinUISampleDemo (Unpackaged)": {
+ "commandName": "Project"
+ }
+ }
+}
\ No newline at end of file
diff --git a/WinUISampleDemo/WinUISampleDemo/ViewModel.cs b/WinUISampleDemo/WinUISampleDemo/ViewModel.cs
new file mode 100644
index 0000000..8ef0df4
--- /dev/null
+++ b/WinUISampleDemo/WinUISampleDemo/ViewModel.cs
@@ -0,0 +1,36 @@
+
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+
+namespace WinUISampleDemo
+{
+ public class ViewModel
+ {
+ public ObservableCollection DailyWaterIntake { get; set; }
+ public ViewModel()
+ {
+ DailyWaterIntake = new ObservableCollection
+ {
+ new WaterConsumption("Monday", 2.5),
+ new WaterConsumption("Tuesday", 3.0),
+ new WaterConsumption("Wednesday", 2.8),
+ new WaterConsumption("Thursday", 3.2),
+ new WaterConsumption("Friday", 2.7),
+ new WaterConsumption("Saturday", 3.5),
+ new WaterConsumption("Sunday", 3.0)
+ };
+ }
+ }
+
+ public class WaterConsumption
+ {
+ public string Day { get; set; }
+ public double Liters { get; set; }
+
+ public WaterConsumption(string day, double liters)
+ {
+ Day = day;
+ Liters = liters;
+ }
+ }
+}
diff --git a/WinUISampleDemo/WinUISampleDemo/WinUISampleDemo.csproj b/WinUISampleDemo/WinUISampleDemo/WinUISampleDemo.csproj
new file mode 100644
index 0000000..5dad71b
--- /dev/null
+++ b/WinUISampleDemo/WinUISampleDemo/WinUISampleDemo.csproj
@@ -0,0 +1,60 @@
+
+
+ WinExe
+ net8.0-windows10.0.19041.0
+ 10.0.17763.0
+ WinUISampleDemo
+ app.manifest
+ x86;x64;ARM64
+ win-x86;win-x64;win-arm64
+ win-$(Platform).pubxml
+ true
+ true
+ enable
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+ False
+ True
+ False
+ True
+
+
\ No newline at end of file
diff --git a/WinUISampleDemo/WinUISampleDemo/app.manifest b/WinUISampleDemo/WinUISampleDemo/app.manifest
new file mode 100644
index 0000000..39bc7bd
--- /dev/null
+++ b/WinUISampleDemo/WinUISampleDemo/app.manifest
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ PerMonitorV2
+
+
+
\ No newline at end of file