Skip to content

misten1/gdilib-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gdilib-rs

crates.io


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!

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages