All Monitor ScreenShot
Even if I have more than one monitor, this code only takes the screenshot of the main monitor, how can I fix this?
14 Replies
GetWindowRect only gives u the size of one monitor
Just wondering if I will use Windows Forms or can I run this code in a console application?
i dont understand :c
The code u post above wont run on console if u dont reference Drawing library either but its possible yes
using System.Drawing.Imaging;
using System.Drawing;
I added it and it works fine but
i dont understand System.Windows.Forsm
how are u adding
did u manually reference the DLL?
i use nuget
also i currently use this code
and ss one screen
can you show me your csproj content
i dont love c# :sadge:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="System.Drawing.Common" Version="8.0.1" />
<PackageReference Include="System.ServiceProcess.ServiceController" Version="8.0.0" />
</ItemGroup>
</Project>
this code currently work but kust one screen
well normally u dont need to nuget those libraries
what u do is u change your csproj to include
just like u almsot have it there
u just missed the -windows
then u should be able to use System.Windows.Forms
alright i will try thx
if u have trouble using the link I posted above let me know is very simple
oki dokie thx
its work thx
@leowest
no worries glad u got it working