pub fn subset_texture_from(
context: &mut DirectContext,
image: &Image,
subset: impl AsRef<IRect>,
) -> Option<Image>
Expand description
Returns subset of this image as a texture-backed image.
Returns None
if any of the following are true:
- Subset is empty
- Subset is not contained inside the image’s bounds
- Pixels in the source image could not be read or copied
- The source image is texture-backed and context does not match the source image’s context.
context
- theDirectContext
to which the subset should be uploaded.subset
- bounds of returnedImage
Returns: the subsetted image, uploaded as a texture, or None