最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

rust - fitting picture to the display in gtk-rs - Stack Overflow

programmeradmin2浏览0评论

Right now I have some simple code that looks like this:

let window = gtk4::ApplicationWindow::new(application);

window.set_default_size(1920, 1080);

let file = <setup for a functional path>;
let picture = gtk4::Picture::for_file(&file);

window.set_child(Some(&picture));
window.show();

The path works and picture renders, so there's no issues there, but there's a small gap of ~10px at the top of the display where the window's border is, despite my display being 1920x1080px. Are there any possible solutions to get the window to fit the entire screen?

I've already tried window.fullscreen() and that causes the image to appear zoomed in (because the raw image I am using is 1440p). Any help is appreciated.

发布评论

评论列表(0)

  1. 暂无评论