没什么卵用,图一乐
代码
use windows_sys::Win32::{
Graphics::Gdi::{BitBlt, GetDC, ReleaseDC, SRCCOPY},
UI::WindowsAndMessaging::{GetSystemMetrics, SM_CXSCREEN, SM_CYSCREEN},
};
fn main() {
unsafe {
let width = GetSystemMetrics(SM_CXSCREEN);
let height = GetSystemMetrics(SM_CYSCREEN);
let (mut x, mut y, mut w, mut h);
loop {
let hdc = GetDC(0);
x = fastrand::i32(1..3000) % (width * 5 / 4) - width / 4;
y = fastrand::i32(1..3000) % (height * 5 / 4) - height / 4;
w = fastrand::i32(1..3000) % width / 2;
h = fastrand::i32(1..3000) % height / 2;
BitBlt(
hdc,
x + fastrand::i32(1..3000) % 3 - 1,
y + fastrand::i32(1..3000) % 5,
w,
h,
hdc,
x,
y,
SRCCOPY,
);
ReleaseDC(0,hdc);
}
}
}
效果
link: https://github.com/kekeimiku/msrs
1
共 6 条评论, 1 页
评论区
写评论Mac路过: 😄
太乐了,巨硬的系统还能这样玩
停不下来了
小众需求,可以做更多的内容
哈哈,好玩,巨硬的力量不可小瞰
Cargo.toml
好活
(可惜我是linux,玩不了)