Add screenshot helpers to iced_test
This commit is contained in:
parent
ea614387f4
commit
085c8fae8d
10 changed files with 183 additions and 78 deletions
|
|
@ -59,7 +59,7 @@ impl Example {
|
|||
image::Handle::from_rgba(
|
||||
screenshot.size.width,
|
||||
screenshot.size.height,
|
||||
screenshot.bytes,
|
||||
screenshot.rgba,
|
||||
),
|
||||
));
|
||||
}
|
||||
|
|
@ -105,7 +105,7 @@ impl Example {
|
|||
image::Handle::from_rgba(
|
||||
screenshot.size.width,
|
||||
screenshot.size.height,
|
||||
screenshot.bytes,
|
||||
screenshot.rgba,
|
||||
),
|
||||
));
|
||||
self.crop_error = None;
|
||||
|
|
@ -243,7 +243,7 @@ async fn save_to_png(screenshot: Screenshot) -> Result<String, PngError> {
|
|||
tokio::task::spawn_blocking(move || {
|
||||
img::save_buffer(
|
||||
&path,
|
||||
&screenshot.bytes,
|
||||
&screenshot.rgba,
|
||||
screenshot.size.width,
|
||||
screenshot.size.height,
|
||||
ColorType::Rgba8,
|
||||
|
|
|
|||
|
|
@ -20,7 +20,8 @@ pub fn main() -> iced::Result {
|
|||
application().run()
|
||||
}
|
||||
|
||||
fn application() -> Application<impl Program<Message = Message>> {
|
||||
fn application() -> Application<impl Program<Message = Message, Theme = Theme>>
|
||||
{
|
||||
iced::application(Todos::new, Todos::update, Todos::view)
|
||||
.subscription(Todos::subscription)
|
||||
.title(Todos::title)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue