scaletransform

XAML: make a ScrollViewer show scrollbars when the ScaleTransform of a child object gets big

天大地大妈咪最大 提交于 2019-12-21 12:32:33
问题 I am making a sort of "print preview" control for some documents in my Silverlight 3 application. I have a Canvas (for showing the document) inside of a ScrollViewer, and I have zoom in / zoom out buttons that control the X and Y Scale properties of the ScaleTransform for the Canvas.RenderTransform property. I want the scrollbars of the ScrollViewer to show up when I "zoom in" enough such that the canvas is no longer visible in the ScrollViewer area, but it seems that they only show up

How to programmatically animate an ImageView

瘦欲@ 提交于 2019-12-21 03:57:30
问题 I am trying to animate an ImageView when the said image view is clicked. Specifically I want the size of the ImageView gets bigger (say .20 bigger) and the immediately shrink back to its original size). So far I have been experimenting with this code with no luck. // thumbLike is the imageView I would like to animate. button.setOnClickListener(new OnClickListener(){ @Override public void onClick(View v) { // TODO Auto-generated method stub ScaleAnimation scaleAnim = new ScaleAnimation(1.0f, 2

transform scale works incorrectly for odd pixel widths

只谈情不闲聊 提交于 2019-12-19 05:49:20
问题 I am trying to scale a div, but keep the inside element at the same position and the same size . To do that, I use transform: scale(value) on wrapper and transform: scale(1/value) on the inside div. The problem is, that the inside div shifts when I change scale. That only happens if width/height of wrapper is odd or not whole. It does not happen for even widths/height of the wrapper. My goal is to have many child elements of wrapper that scale alongside wrapper, but only one that does not.

Calculate scaling factor for converting point1( x,y coordinates) of one rectangle to Point1( x,y) of a different rectangle

匆匆过客 提交于 2019-12-19 04:21:34
问题 Process of scaling x,y coordinates of one rectangle to other rectangle coordinates is pretty simple as better explained at this link http://www.icoachmath.com/math_dictionary/scale_factor.html if we have two rectangle one is having Maxwidth: 2000 and Maxheight: 1000 and second rectangle of size MaxWidth : 4000 and MaxHeight = 2000 so scale factor for converting coordinate of rect1 to rect2 would be for x in rect2 : (x in rect1) * (MaxWidth of Rect2/ MaxWidht of Rect1) for y in rect2 : (y in

Keep certain Objects from scaling

感情迁移 提交于 2019-12-13 05:50:42
问题 I have a WPF Canvas with a few objects on it and I apply a ScaleTransform animation to it (Zoom). As expected all objects scale with the canvas. It is possible that some objects remain their size even if they are children of the canvas? So far my only idea is another scale animation running in the opposite direction to scale to objects down again. 回答1: Simply put, no. the ScaleTransform will catch an element, and all it's children. You can only resort to tricks like you suggested. 来源: https:/

Apply ScaleTransform to Graphics GDI+

孤街醉人 提交于 2019-12-10 19:17:23
问题 I have put this simple code together to draw a line. Now I want to apply a ScaleTransform to it by a factor of 10; but the code below doesn't work. var bitmap = new Bitmap(pictureBox1.Size.Width, pictureBox1.Size.Height); var g = Graphics.FromImage(bitmap); pictureBox1.Image = bitmap; var pn = new Pen(Color.Wheat, -1); g.DrawLine(pn, 0, 0, 10, 10); pn.Dispose(); // I'm trying to scaletransform here! g.ScaleTransform(10, 10); Update: What is the correct way to update the changes? I'm not

How to rotate, translate and scale a control object around an specific point in WPF

一笑奈何 提交于 2019-12-10 14:32:38
问题 I have a custom built control, which is a rectangle with a few details inside it, but it is a rectangle. I have a center point (X,Y), which I call "Center of Gravity", which "represents" the point. This means that when I set a new position to the object, I want this point to be in the set position. When I rotate the object, I need it to rotate around this point. And when I scale the object, the point must remain in the position set before. Only the size of the object must change. For example,

matrix scale transition not working

て烟熏妆下的殇ゞ 提交于 2019-12-09 16:08:39
问题 I have to use the transform matrix to animate transform: scale of an element. I want to scale from 0 to 1. If I use the following code it works properly: .container { width: 200px; height: 100px; background: yellow; transform: scale(0); transition: transform 1s; } .container.open { transform: scale(1); } https://jsfiddle.net/w4kuth78/1/ If I use the matrix itself, it is not working. .container { width: 200px; height: 100px; background: yellow; transform: matrix(0, 0, 0, 0, 0, 0); transition:

Scale transform in xaml (in a controltemplate) on a button to perform a “zoom”

岁酱吖の 提交于 2019-12-09 11:47:55
问题 I've got a button with an image in it and it's being styled by the following: <ControlTemplate x:Key="IconButton" TargetType="Button"> <Border> <ContentPresenter Height="80" Width="80" /> </Border> <ControlTemplate.Triggers> <EventTrigger RoutedEvent="Button.Click"> <BeginStoryboard> <Storyboard TargetProperty="Opacity"> <DoubleAnimation From="1" To="0.5" Duration="0:0:0.5" /> <DoubleAnimation From="0.5" To="1" Duration="0:0:0.5" /> </Storyboard> </BeginStoryboard> </EventTrigger>

Generalizing the ScaleTransform (WPF) when image is not aligned to x-y axes

守給你的承諾、 提交于 2019-12-07 20:49:05
问题 My linear algebra is weak. WPF is a great system for Rendering different transformations upon an image. However, the standard ScaleTransform will only scale the image's along the x-y axes. When the edges have first been rotated, the result of applying the ScaleTransform will result in a skewed transformation (as shown below) since the edges are no longer aligned. So, if I have an image that has undergone several different transforms with the result being shown by the WPF rendering system, how