Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tile mode for background image stretch #3193

Open
Tracked by #9995
StrScr opened this issue Oct 14, 2019 · 2 comments
Open
Tracked by #9995

Tile mode for background image stretch #3193

StrScr opened this issue Oct 14, 2019 · 2 comments
Labels
Area-UserInterface Issues pertaining to the user interface of the Console or Terminal Help Wanted We encourage anyone to jump in on these. Issue-Task It's a feature request, but it doesn't really need a major design. Priority-3 A description (P3) Product-Terminal The new Windows Terminal.
Milestone

Comments

@StrScr
Copy link

StrScr commented Oct 14, 2019

Description of the new feature/enhancement

I'm trying to use a patterned GIF as a background image, but didn't find an option to tile it. A new option for setting the stretch mode to tile the image would be great. It would be a nice option as images like these simply don't look good under other modes or require extra effort to make them work, such as editing them and tiling them manually.

Here's the GIF I'm trying to use:
pmttyd

Proposed technical implementation details (optional)

Allow setting the "backgroundImageStretchMode" setting in the profiles to something like "tile". This would display the image at its native resolution from the top-left corner, repeating the image across the background until it's entirely covered.

@StrScr StrScr added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Oct 14, 2019
@ghost ghost added Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Oct 14, 2019
@DHowett-MSFT DHowett-MSFT added Area-UserInterface Issues pertaining to the user interface of the Console or Terminal Help Wanted We encourage anyone to jump in on these. Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal. and removed Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Oct 14, 2019
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Oct 14, 2019
@DHowett-MSFT DHowett-MSFT added this to the Terminal Backlog milestone Oct 14, 2019
@DHowett-MSFT
Copy link
Contributor

(I love this idea.)

@carlos-zamora
Copy link
Member

Got a chance to work on this a bit. Uploaded my branch to dev/cazamor/tile-background.

I was able to add the tile setting to backgroundImageStretchMode. I had to create a new enum which wasn't too bad.

The real problem here is that WUX::Controls::Image does not have a tile setting.

I was able to remove the Image control, and instead have the background image appear as the Background property for the Grid we're using in the Terminal Control (Grid.Background docs). The difference here, though, is that Grid.Background uses a Brush (or, in our case, an ImageBrush).

So, this gets us closer, but the big problem here is we need to create something like a TileImageBrush to extend an ImageBrush. And this TileImageBrush would just do the following:

  • get the size of the canvas it's trying to fill
  • get the size of the image it's trying to draw
  • repeatedly use the ImageBrush to draw the image in a tile format (doable with the two things above)

I'll probably be working on this as a side project, but if anybody has any thoughts on a different approach, or would like to take a stab at it, I've uploaded my branch to dev/cazamor/tile-background for you to try out. 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-UserInterface Issues pertaining to the user interface of the Console or Terminal Help Wanted We encourage anyone to jump in on these. Issue-Task It's a feature request, but it doesn't really need a major design. Priority-3 A description (P3) Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests

4 participants