Crates.io | gdilib-rs |
lib.rs | gdilib-rs |
version | 0.1.3 |
source | src |
created_at | 2023-04-06 17:11:56.450839 |
updated_at | 2023-04-07 14:28:40.574759 |
description | GDI library for desktop effects |
homepage | |
repository | https://github.com/Jaranamo1/gdilib-rs/ |
max_upload_size | |
id | 832367 |
size | 15,726 |
A simple library that supplies functions for easy GDI manipualation of the desktop using winapi
// Applies a simple RGB glitch using BitBlt onto the desktop of the current user
unsafe {
let my_desktop = effects::get_desktop();
my_desktop.rgb_glitch();
my_desktop.close(); // Cleanup
}
// Draws a red rectangle on the user's desktop
unsafe {
let my_desktop = effects::get_desktop();
let mut rectangle = utils::create_rect(10, 10, 100, 100); // x, y, width, height
my_desktop.fill_rect(&mut rectangle, utils::rgb_to_colorref(255, 0, 0));
my_desktop.close();
}
SingleEffect allows you to execute one effect defined by a enum in complexeffect::EFFECTS
let desktop = effects::get_desktop();
let my_effect = SingleEffect::new(FLIPH); // Flip horizontally
unsafe {
my_effect.execute(&desktop);
desktop.close();
}
You can chain effects together easily using EffectChain
let desktop = effects::get_desktop();
// 10ms delay inbetween effects
let my_effect = EffectChain::new(10, vec![FLIPH, RGB, MELT, FLIPV]); // Easily chain effects together
unsafe {
// Execute all effects
my_effect.execute(&desktop);
// Cleanup
desktop.close();
}