五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

[C#]當屏幕檢測到白色啟動原神,黑色啟動星穹鐵道的抽象項目

2023-08-16 23:37 作者:瘋狂的戰(zhàn)斗雞plus  | 我要投稿


首先:這玩意兒就是純純的整活,一個小時就完成了,大家就當看個樂呵


靈感來自于基于【白屏檢測】的 原神啟動器

以及其評論

就是這位老哥

于是就用C#做了這么一個玩意兒

界面先隨便看著吧

使用方法也是十分的簡單,只要輸入原神和星鐵的exe地址之后當檢測到全屏的白色或者黑色就會啟動對應的游戲十分簡單粗暴

接下來是代碼:


public Form1()

? ? ? ? {

? ? ? ? ? ? InitializeComponent();

? ? ? ? }

? ? ? ? bool isshowW =false;

? ? ? ? bool isshowB = false;

? ? ? ? private void Timer_Tick(object sender, EventArgs e)

? ? ? ? {

? ? ? ? ? ? Rectangle rectangle = Screen.PrimaryScreen.Bounds;

? ? ? ? ? ? Bitmap bitmap = new Bitmap(rectangle.Width, rectangle.Height, PixelFormat.Format32bppArgb);

? ? ? ? ? ? Graphics g = Graphics.FromImage(bitmap);

? ? ? ? ? ? g.CopyFromScreen(rectangle.Left, rectangle.Top, 0, 0, bitmap.Size);


? ? ? ? ? ? int totalPixels = bitmap.Width * bitmap.Height;

? ? ? ? ? ? int rSum = 0, gSum = 0, bSum = 0;


? ? ? ? ? ? BitmapData bitmapData = bitmap.LockBits(new Rectangle(0, 0, bitmap.Width, bitmap.Height), ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb);

? ? ? ? ? ? IntPtr ptr = bitmapData.Scan0;


? ? ? ? ? ? int bytes = Math.Abs(bitmapData.Stride) * bitmap.Height;

? ? ? ? ? ? byte[] rgbValues = new byte[bytes];


? ? ? ? ? ? Marshal.Copy(ptr, rgbValues, 0, bytes);


? ? ? ? ? ? for (int i = 0; i < bytes; i += 4)

? ? ? ? ? ? {

? ? ? ? ? ? ? ? byte b = rgbValues[i];

? ? ? ? ? ? ? ? byte gs = rgbValues[i + 1];

? ? ? ? ? ? ? ? byte r = rgbValues[i + 2];


? ? ? ? ? ? ? ? rSum += r;

? ? ? ? ? ? ? ? gSum += gs;

? ? ? ? ? ? ? ? bSum += b;

? ? ? ? ? ? }


? ? ? ? ? ? bitmap.UnlockBits(bitmapData);

? ? ? ? ? ? bitmap.Dispose();

? ? ? ? ? ? g.Dispose();


? ? ? ? ? ? int avgR = rSum / totalPixels;

? ? ? ? ? ? int avgG = gSum / totalPixels;

? ? ? ? ? ? int avgB = bSum / totalPixels;


? ? ? ? ? ? bool isScreenWhite = IsColorCloseToWhite(avgR, avgG, avgB);

? ? ? ? ? ? bool isScreenBlack = IsColorCloseToBlack(avgR, avgG, avgB);


? ? ? ? ? ? if (isScreenWhite)

? ? ? ? ? ? {

? ? ? ? ? ? ? ? // 屏幕全白,執(zhí)行相應操作

? ? ? ? ? ? ? ? if(isshowW == false)

? ? ? ? ? ? ? ? {

? ? ? ? ? ? ? ? ? ? Process.Start(textBox1.Text);

? ? ? ? ? ? ? ? ? ? isshowW = true;

? ? ? ? ? ? ? ? }

? ? ? ? ? ? }

? ? ? ? ? ? else if (!isScreenWhite)

? ? ? ? ? ? {

? ? ? ? ? ? ? ? isshowW = false;

? ? ? ? ? ? }

? ? ? ? ? ? if (isScreenBlack)

? ? ? ? ? ? {

? ? ? ? ? ? ? ? if (isshowB == false)

? ? ? ? ? ? ? ? {

? ? ? ? ? ? ? ? ? ? Process.Start(textBox2.Text);

? ? ? ? ? ? ? ? ? ? isshowB = true;

? ? ? ? ? ? ? ? }

? ? ? ? ? ? }

? ? ? ? ? ? else if (!isScreenBlack)

? ? ? ? ? ? {

? ? ? ? ? ? ? ? isshowB = false;

? ? ? ? ? ? }

? ? ? ? }


? ? ? ? private bool IsColorCloseToWhite(int r, int g, int b)

? ? ? ? {

? ? ? ? ? ? // 定義一個閾值,判斷顏色是否接近白色

? ? ? ? ? ? int threshold = 250;

? ? ? ? ? ? return r >= threshold && g >= threshold && b >= threshold;

? ? ? ? }

? ? ? ? private bool IsColorCloseToBlack(int r, int g, int b)

? ? ? ? {

? ? ? ? ? ? // 定義一個閾值,判斷顏色是否接近白色

? ? ? ? ? ? int threshold = 15;

? ? ? ? ? ? return r <= threshold && g <= threshold && b <= threshold;

? ? ? ? }

? ? ? ? bool isqidong =false;

? ? ? ? private void button1_Click(object sender, EventArgs e)

? ? ? ? {

? ? ? ? ? ? Timer timer = new Timer();

? ? ? ? ? ? timer.Tick += Timer_Tick;

? ? ? ? ? ? if (!isqidong)

? ? ? ? ? ? {

? ? ? ? ? ? ? ? timer.Start();

? ? ? ? ? ? ? ? button1.Text = "停止";

? ? ? ? ? ? ? ? isqidong = true;

? ? ? ? ? ? }

? ? ? ? ? ? else

? ? ? ? ? ? {

? ? ? ? ? ? ? ? timer.Stop();

? ? ? ? ? ? ? ? button1.Text = "啟動";

? ? ? ? ? ? ? ? isqidong = false;

? ? ? ? ? ? }

? ? ? ? ? ??

? ? ? ? }

? ? }

(放心絕對綠色無污染)
下載地址:

鏈接:https://pan.baidu.com/s/1ghSbFrOEZ0-_RlVf1uxegQ?pwd=f9rk?

提取碼:f9rk

順便預告一下下一個視頻

炒冷飯


[C#]當屏幕檢測到白色啟動原神,黑色啟動星穹鐵道的抽象項目的評論 (共 條)

分享到微博請遵守國家法律
华池县| 金寨县| 寻乌县| 潞西市| 台州市| 民勤县| 大关县| 尚志市| 新绛县| 明光市| 清水县| 温泉县| 思南县| 铁岭县| 蒙阴县| 无为县| 南江县| 高陵县| 和政县| 敦化市| 郸城县| 三穗县| 沙洋县| 广汉市| 清苑县| 河西区| 和平区| 林周县| 象州县| 澄江县| 习水县| 濮阳市| 宜州市| 望城县| 安徽省| 卢湾区| 辰溪县| 青田县| 沾益县| 竹山县| 大同县|