gdilib-rs

Crates.iogdilib-rs
lib.rsgdilib-rs
version0.1.3
sourcesrc
created_at2023-04-06 17:11:56.450839
updated_at2023-04-07 14:28:40.574759
descriptionGDI library for desktop effects
homepage
repositoryhttps://github.com/Jaranamo1/gdilib-rs/
max_upload_size
id832367
size15,726
misten (misten1)

documentation

README

gdilib-rs


A simple library that supplies functions for easy GDI manipualation of the desktop using winapi

Examples

// 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();
}

Advanced effects

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();
}

todo:

  • Add more effects
  • Make completely custom effects possible

Have fun!

Commit count: 11

cargo fmt