pub fn fade(
img1: &PhotonImage,
img2: &PhotonImage,
start_x: i32,
end_x: i32,
start_y: i32,
end_y: i32,
) -> PhotonImageExpand description
Fades one image into another.
For horizontal fading, set both start_y and end_y to the same value.
For vertical fading, set both start_x and end_x to the same value.
Otherwise, axial fading is applied.
§Arguments
img1- Image to fade from. Must be the same size as img2.img2- Image to fade to. Must be the same size as img1.start_x- Column where the fading begins.end_x- Column where the fading ends.start_y- Row where the fading begins.end_y- Row where the fading ends.
§Example
use photon_rs::multiple::fade;
use photon_rs::native::open_image;
let img1 = open_image("img1.jpg").expect("File should open");
let img2 = open_image("img2.jpg").expect("File should open");
let _faded_img = fade(&img1, &img2, 0, 100, 0, 100);