We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
area
Texture::load_from_image
1 parent 23e27d0 commit 0756740Copy full SHA for 0756740
src/graphics/texture.rs
@@ -127,7 +127,12 @@ impl Texture {
127
/// Load texture from an image
128
///
129
/// # Arguments
130
- /// * image - Image to upload to the texture
+ ///
131
+ /// - `image`: Image to upload to the texture
132
+ /// - `area`: Can be used to load only a sub-rectangle of the whole image.
133
+ /// If you want the entire image then use a default `IntRect`.
134
+ /// If the area rectangle crosses the bounds of the image,
135
+ /// it is adjusted to fit the image size.
136
pub fn load_from_image(&mut self, image: &Image, area: IntRect) -> SfResult<()> {
137
unsafe { ffi::sfTexture_loadFromImage(self, image.raw(), area).into_sf_result() }
138
}
0 commit comments