Created
January 4, 2026 08:57
-
-
Save skydoves/d502b810a45a14dfe01f916a68dd2b99 to your computer and use it in GitHub Desktop.
Landscapist: Automatic Downsampling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Without explicit size - calculates from Compose constraints | |
| LandscapistImage( | |
| model = "https://example.com/large-image.jpg", | |
| modifier = Modifier.size(200.dp) // Auto-calculates target size | |
| ) | |
| // With explicit size constraint | |
| val request = ImageRequest.builder() | |
| .model(imageUrl) | |
| .size(width = 400, height = 300) // Target size in pixels | |
| .build() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment