scaletransform

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

末鹿安然 提交于 2019-12-06 13:22:10
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 do I calculate the correct matrix transform to take the (final rotated image) and scale it along the

Android - Flip Animation not flipping smoothly

不羁岁月 提交于 2019-12-04 11:20:48
问题 I want to make my image to flip horizontally for 4 times, and at the same time scaling it down. I have the following code for flipping: ObjectAnimator flipAnimation = ObjectAnimator.ofFloat(view, "rotationY", 0.0f, 1440f); flipAnimation.setDuration(4000); flipAnimation.start(); And I have the following code in scale_down.xml for scaling down: <scale android:duration="4000" android:fromXScale="1" android:fromYScale="1" android:pivotX="50%" android:pivotY="50%" android:toXScale="0.1" android

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

空扰寡人 提交于 2019-12-04 05:32:47
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 depending on the Width/Height of the Canvas itself, regardless of whether it is zoomed in or not. Can anyone

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

给你一囗甜甜゛ 提交于 2019-12-03 15:06:45
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> <EventTrigger RoutedEvent="Mouse.MouseEnter"> <BeginStoryboard> <Storyboard TargetProperty="Width">

WPF Canvas Scaling/Transform to Fit

本秂侑毒 提交于 2019-12-03 08:48:02
问题 I'm reposting this question as I didn't get much of a response last time, hopefully a bit of re-wording might help... Essentially what I'm trying to do is to create a databound canvas, that will automatically scale its contents to 'fill' up the available space. Sort of like a zoom to fit operation. Unfortunately my WPF skills aren't yet very strong, and I'm struggling to work out how to do this last part. I've followed some databinding examples to get the canvas bound, but not sure if maybe

Android - Flip Animation not flipping smoothly

久未见 提交于 2019-12-03 07:05:15
I want to make my image to flip horizontally for 4 times, and at the same time scaling it down. I have the following code for flipping: ObjectAnimator flipAnimation = ObjectAnimator.ofFloat(view, "rotationY", 0.0f, 1440f); flipAnimation.setDuration(4000); flipAnimation.start(); And I have the following code in scale_down.xml for scaling down: <scale android:duration="4000" android:fromXScale="1" android:fromYScale="1" android:pivotX="50%" android:pivotY="50%" android:toXScale="0.1" android:toYScale="0.1" > </scale> However, when I run my app on emulator in eclipse, the flipping image shows an

WPF Canvas Scaling/Transform to Fit

≡放荡痞女 提交于 2019-12-02 22:41:46
I'm reposting this question as I didn't get much of a response last time, hopefully a bit of re-wording might help... Essentially what I'm trying to do is to create a databound canvas, that will automatically scale its contents to 'fill' up the available space. Sort of like a zoom to fit operation. Unfortunately my WPF skills aren't yet very strong, and I'm struggling to work out how to do this last part. I've followed some databinding examples to get the canvas bound, but not sure if maybe its wrong and hindering me. I've got two basic problems at the moment depending on the way I try and

transform scale works incorrectly for odd pixel widths

我的未来我决定 提交于 2019-12-01 03:50:55
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. Take a look at this example to see problem in action (hover to scale). Example with no issue , inner

d3 getting invert value of Band Scales

核能气质少年 提交于 2019-11-30 19:50:05
i am writing a Gantt Chart using d3 i have xScale with Time Scale(Time) this.xScale = d3.scaleTime() .domain([this.startDate,this.endDate]) .range([0,this.getWidth()]); and yScale as Band Scale (Resources) this.yScale = d3.scaleBand() .domain(resources.map(function(res){ return res.res_num; })) .rangeRound([0,this.getHeight()]) .paddingInner(.3) Problem is i need to drag and drop the task( SVG Rect) from one resource to another resources When i drag i am using the transfrom so its moving on the SVG _onDrag : function(d) { var x = d3.event.dx+d3.event.x; var y = d3.event.dy+d3.event.y; d3

Improving WPF Canvas performance

自古美人都是妖i 提交于 2019-11-30 06:38:31
问题 I am developing a Maps like application using WPF. I have ~10,000 PathGeometry, Shapes added to the canvas. I have added ScaleTransform and TranslateTransform for zooming and panning controls. The problem I'm facing is, when I zoom or pan, there is slight lag. Is there a way to organize the data so that I handle only the Shapes that are visible? Any hints on making it more efficient will be helpful and appreciated. 回答1: I suggest you have a look at this interesting article, with the concept