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
6
votes
1 answer

SVG - Calculate a transform matrix to an SVG with a different viewbox

i have an SVG with an viewbox 0 0 500 500 and a transform matrix 0.8,0,0,0.8,54,54 now i want to add this transform to other SVGs. The problem is that all the other SVGs has an different viewbox. So i wrote a function to calculate the transform…
Peter
  • 11,413
  • 31
  • 100
  • 152
6
votes
2 answers

Is it possible to escape an SVG viewbox? (or how to position HTML DIV over scaled/transformed SVG?)

In this document: html, body { height: 100%; margin: 0; padding: 0; overflow: hidden } #content { width: 100%; height: 100% }
Miral
  • 12,637
  • 4
  • 53
  • 93
5
votes
1 answer

SVG viewBox zoom in center (Raphael)

I try to zoom with mousewheel on a Raphael paper using viewBox. Here is the JSFiddle code. it works but now i want to zoom in the center and i have no idea where to start. I guess i should change the viewBox x and y coordinates. I have tried this…
user1085803
  • 51
  • 1
  • 1
  • 2
5
votes
1 answer

Zoom in and out a ViewBox with mouse scroll and use mouse pointer location as zoom origin

The title is pretty much self-explaining, but to add to the facts, I'm using a large Canvas inside my ViewBox and my ViewBox is placed inside a ScrollViewer. I've set the event handlers for the MouseMove and MouseWheel, and I'm using myViewbox.Width…
iXed
  • 157
  • 2
  • 3
  • 9
5
votes
2 answers

How do I get a textblock with textwrapping to fill a viewbox

The XAML is a page with a list of items on it inside a Viewbox. The goal is to have a department name and them a paragraph of notes underneath that. I set the background of my itemscontrol to be Red to make it easy to see how it fills in the…
Jon Dosmann
  • 667
  • 7
  • 20
5
votes
5 answers

A grid, a Viewbox, and a Canvas

Ok, I have a Grid which 'auto sizes' to a web browser. In there I have a Canvas with shapes drawn onto it. What I want is for the canvas to 'stretch' to fill the page. I tried using a Viewbox from the Silverlight 3 10/09 Toolkit but it does not…
JasonRShaver
  • 4,344
  • 3
  • 32
  • 39
5
votes
1 answer

How to retrieve element's coordinates relative to an svg viewbox?

In my index.html I have an svg viewbox: I wish to animate an svg ellipse I have created such that when the ellipse is clicked it moves vertically to a certain y point we'll call TOP, and if…
steve
  • 2,488
  • 5
  • 26
  • 39
4
votes
1 answer

SVG viewBox is not working with nested svgs at a negative position

In this example, the green circle is cut off
Drew LeSueur
  • 19,185
  • 29
  • 89
  • 106
4
votes
2 answers

SVG viewBox reversing Y-coordinates

I'm using SVG to draw in a HTML page different shapes. These different shapes are retrieved from geometry objects of a spatial database in Microsoft Sql Server. The problem I'm facing is that the system of coords (Svg and Microsoft Sql Server) is…
4
votes
2 answers

Scaling an SVG within an HTML viewbox

I need some help with scaling an SVG in a HTML viewbox. I am playing around in a HTML template for a website and want to change the standard SVG image of the template to another image. I cannot get the new SVG with the path d=" something, something"…
D_K_R
  • 45
  • 1
  • 4
4
votes
5 answers

Troubles resizing SVG in Raphael

I am trying to draw this svg of europe using raphael. For each path in the svg, I've parsed it and do: r.path([countrypath]). This works, but the problem is that it is gigantic. For example, some of the paths look like M 11689.234, 6005.2561... It…
iboeno
  • 3,809
  • 4
  • 20
  • 13
4
votes
1 answer

WPF: How to link two ViewBoxes?

Is it possible, to link two ViewBoxes, so that they always use the same scale factor? Or is it possible, to extract the current scale factor of a ViewBox to use in a ScaleTransform of another element? Thank you.
Nostromo
  • 1,177
  • 10
  • 28
4
votes
1 answer

SVG viewBox to VML coordorigin/coordsize

I'm unsure how to convert the following SVG snippet containing a viewBox attribute to VML coordorigin and coordsize attributes.
zachwill
  • 4,395
  • 3
  • 19
  • 17
4
votes
1 answer

Advantages/Disadvantages of using Viewbox to scale C# XAML

Windows Store app written using C#/VS2013.1 I have wrapped up a complex Grid/StackPanel arrangement with buttons, images, checkboxes all inside a Viewbox tag like below:
JJLL
  • 374
  • 4
  • 13
4
votes
2 answers

C# wpf control in viewbox but cannot get real size

I use viewbox in the window of wpf, and the control is added programmatically. I hope the controls in the window can be flexible when the window size changed. However, the appearance of the controls seems be changed, the width and height not…
Shuinvy
  • 251
  • 2
  • 6
  • 23
1 2
3
23 24