Questions tagged [viewbox]

The ViewBox is a very useful control in WPF. If does nothing more than scale to fit the content to the available size. It does not resize the content, but it transforms it.

358 questions
0
votes
1 answer

How to create a symbol from another symbol using viewBox properly?

The following SVG does not display as I expect it to. The brief description/ intent is: I create a symbol which is a large square comprised of smaller rectangles I then create "slices" of this large square in smaller symbols using viewBox and…
bguiz
  • 27,371
  • 47
  • 154
  • 243
0
votes
1 answer

Why is this svg code not working

Show Svg
0
votes
0 answers

Forcing a Textblock in WPF to use all available vertical space and wrap its content

I have a simple Grid with an Image on the left side and a TextBlock on the right, each contained by a ViewBox to handle scaling. The ViewBox.Height containing the TextBlock is bound to Image.ActualHeight. Here is what I get: But what I actually…
Hannes
  • 273
  • 3
  • 14
0
votes
2 answers
0
votes
1 answer

SVG full Width, while keeping img proportions

I've got an svg image which I want to autoresize to 100% width. The problem is, that I've placed an Image (100px x 100px) on the left side of that svg and that picture has to keep its proportions. I tried it with viewBox, but with this method the…
0
votes
1 answer

Drawing Viewbox using a DrawingContext

I'm writing a WPF application. All icons I use are vector and stored in standalone ResourceDictionary as series of Viewboxes:
Spook
  • 25,318
  • 18
  • 90
  • 167
0
votes
2 answers

Why are letters scaling to different sizes in comparable view boxes within WPF?

I am attempting to create an onscreen keyboard using a Grid for key layout. Each key consists of a Border with a TextBlock containing a letter. To make the letters scale I have wrapped each TextBlock in a ViewBox, for example;
Julius
  • 735
  • 1
  • 9
  • 25
0
votes
1 answer

Position element at center of svg viewbox using javascript

i have a svg with, lets say, 3 elements. i want to place all these elements at center of svg canvas. Now important thing is that i am using 'viewBox' property of svg to zoom and pan. i want to use JavaScript to calculate exact position and then…
RashFlash
  • 992
  • 2
  • 20
  • 40
0
votes
1 answer

How to Center Image in ViewBox

I am populating a ViewBox with an image, although I cannot seem to get it to center on the image. I've tried setting the ViewBox Fill to UniformToFill, centering the Image vertically and horizontally, etc and nothing seems to work. XAML
Matthew
  • 3,976
  • 15
  • 66
  • 130
0
votes
1 answer

Repeating background image on a svg rect element that is using clip-path

I want to add a repeating background image to a svg rect element that is using a clip-path. The svg file must have a viewbox attribute. See the fiddle (http://jsfiddle.net/tbbtester/ES9cB/2/) - I want the triangle to have a background that looks…
user3755716
  • 75
  • 1
  • 5
0
votes
1 answer

Force Size on a Viewbox's Children

So I have a rather interesting question. I have a viewbox that has a few elements in it (a custom user control for an image, a canvas, a label, and a textbox). What I want is to try and have all elements scale with the viewbox, but I want the…
Jimmy
  • 941
  • 2
  • 8
  • 27
0
votes
3 answers

Align a viewbox while maintaining stretch

I have a grid(see images below) that contains some text(in a another grid (pink area)) and a Datagrid which contains a few rows with categorized data (blue area). The blue area is always located at the bottom and has a fixed height and is working…
Deruijter
  • 2,077
  • 16
  • 27
0
votes
2 answers

Make SVG Image ignore parent viewBox

I have image inside svg with viewBox, is it possible to make image ignore scaling caused by viewBox and always keep size image 50x50?
Ruben Nagoga
  • 2,178
  • 1
  • 19
  • 30
0
votes
1 answer

How to make image visible when contained in a ViewBox?

I have added added an image to my layout,contained in a Viewbox but when I run the application the image KinectVideo doesn't show on screen. Is there a property I'm missing in the layout orshould I rearrange the image in the layout to make it…
Brian Var
  • 6,029
  • 25
  • 114
  • 212
0
votes
1 answer

WPF Viewbox only shrink if I shrink the window horizontally

I have a grid in a Viewbox. If shrink the width of my window the grid getting smaller.. but if I shrink the height, nothing happened.
rakete
  • 2,953
  • 11
  • 54
  • 108