Evade
Evade
CC#
Created by Evade on 5/16/2024 in #help
how to build solution
whenever I build my solution in jetbrains rider, it says "Build completed" but I cannot find the file anywhere. (I checked the solution file's dictionary but there is nothing there).
5 replies
CC#
Created by Evade on 5/14/2024 in #help
Cannot resolve symbol 'ServiceController'
How can I install ServiceController ?
4 replies
CC#
Created by Evade on 5/14/2024 in #help
The type or namespace name 'Screen' does not exist in the namespace 'System.Windows.Forms'
no clue why code:
using System;
using System.Drawing;
using System.Windows.Forms;

class Program
{
static void Main()
{
// Define the RGB color to check
Color colorToCheck = Color.FromArgb(255, 255, 100);

// Capture the screen
using (Bitmap screenBitmap = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height))
{
using (Graphics g = Graphics.FromImage(screenBitmap))
{
g.CopyFromScreen(0, 0, 0, 0, screenBitmap.Size);
}

// Check if the color is present on the screen
bool colorFound = false;
for (int x = 0; x < screenBitmap.Width; x++)
{
for (int y = 0; y < screenBitmap.Height; y++)
{
if (screenBitmap.GetPixel(x, y) == colorToCheck)
{
colorFound = true;
break;
}
}
if (colorFound)
break;
}

// Print the result
if (colorFound)
{
Console.WriteLine("The RGB color (255, 255, 100) is displayed on the screen.");
}
else
{
Console.WriteLine("The RGB color (255, 255, 100) is not displayed on the screen.");
}
}
}
}
using System;
using System.Drawing;
using System.Windows.Forms;

class Program
{
static void Main()
{
// Define the RGB color to check
Color colorToCheck = Color.FromArgb(255, 255, 100);

// Capture the screen
using (Bitmap screenBitmap = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height))
{
using (Graphics g = Graphics.FromImage(screenBitmap))
{
g.CopyFromScreen(0, 0, 0, 0, screenBitmap.Size);
}

// Check if the color is present on the screen
bool colorFound = false;
for (int x = 0; x < screenBitmap.Width; x++)
{
for (int y = 0; y < screenBitmap.Height; y++)
{
if (screenBitmap.GetPixel(x, y) == colorToCheck)
{
colorFound = true;
break;
}
}
if (colorFound)
break;
}

// Print the result
if (colorFound)
{
Console.WriteLine("The RGB color (255, 255, 100) is displayed on the screen.");
}
else
{
Console.WriteLine("The RGB color (255, 255, 100) is not displayed on the screen.");
}
}
}
}
18 replies
CC#
Created by Evade on 5/14/2024 in #help
issue while importing Bitmap
hello, I am trying to import Bitmap using using System.Drawing; but the code is not recognizing it and I'm not sure what to do. I also tried adding System.Drawing as a reference but I cannot find anything besides my main class in the reference tab on jetbrains rider.
5 replies