How to Rotate a Rectangle on Y axis, CompositeTransform and Rotate Transform has only X Axis rotation method?
Use the Projection property and assign a PlanarProjection value. It's pretty front and center when you edit it in Blend.
EDIT* Example
<TextBlock
Text="Hello"
FontSize="96"
HorizontalAlignment="Center"
VerticalAlignment="Center">
<TextBlock.Projection>
<PlaneProjection
RotationY="45"/>
</TextBlock.Projection>
</TextBlock>
Related
In my WP8 app I want to add an image to listpicker Backgrond.
How can I add it?
<toolkit:ListPicker ExpansionMode="FullScreenOnly" Header="blabla:" Name="mylistpicker" Margin="0,395,222,47">
</toolkit:ListPicker>
<toolkit:ListPickerPage>
<toolkit:ListPickerPage.Background>
<ImageBrush ImageSource="=/images/bg3.png"/>
</toolkit:ListPickerPage.Background>
</toolkit:ListPickerPage>
It did not work for me.
any other code please?
If you want an Image in Background of ListPicker, You can add ListPicker within a Grid and set Grid Background property to your desired Image.
<Grid Background="/path/a.jpg">
//add ListPicker Here
</Grid>
I'm trying to create an "overlap" effect (for lack of a better term). There will be a splitter that when moved, exposes a different view of two similar images (e.g. between colored and grayscale).
I plan on using CustomGridSplitter from WinRTXAMLToolkit (due to WinRT's lack of a splitter). I'm thinking of starting with a grid similar to:
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="10" />
<RowDefinition />
</Grid.RowDefinitions>
<controls:CustomGridSplitter Grid.Row="1" Opacity="0.25"/>
</Grid>
... but I'm not sure how to proceed. If I specify two image controls on the first and third row (or column), how do prevent the image controls from moving (or so)? Also, is it possible to do this diagonally?
You could use two Rectangles that use an ImageBrush or two Image controls that use a Clip property to clip their contents. Unfortunately you can't have diagonal clips in WinRT, only rectangular ones. Maybe you could check if combining multiple RotateTransforms with a Clip would work, you never know. Other than above I would use a Slider instead of a GridSplitter for your scenario.
I am looking for a way to draw an image on a context2D with rotation of the image.
I tried:
imageElement.getStyle().setProperty("transform", "rotate(-45deg)");
It did not work and the image was not rotated.
Any other ways to rotate the image?
Use the setTransform method to apply the transformation on the Context2D, then drawImage.
I want to display list of items in my Metro applications. And I want to just display them. I don't want any kind selection, mouse-over, keyboard control, or animation effects.
The items will be displayed with ItemTemplate, the list will be data-bound and I want scrolling (both vertical and horizontal).
What would be the simplest way to do this? The ListView has lots of defaults, that make "simply displaying" items a heroic task.
The ListView can get rid of almost everything you want by setting SelectionMode="None" and IsHitTestVisible="False". This will give you no selection or highlight of any elements with mouse or keyboard. You will still get scrolling and supporting interactions for scrolling. You will still get animations, however.
Otherwise, you will probably have to look at using an ItemsControl and ScrollViewer to get the effect you want.
Use the ItemsControl in the first instance. You add your data template as you desire and use the ItemsPanel control to apply your layout. For example, the StackPanel below allows the orientation to switch to horizontal.
<ItemsControl ItemsSource="{Binding Users}" >
<ItemsControl.ItemTemplate>
<DataTemplate>
<Image Source="{Binding ImageUri}" Width="40" Height="40" Margin="5" />
</DataTemplate>
</ItemsControl.ItemTemplate>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
Where does the .x and .y property of a movieclip in actionscript 3.0 measured from? from the centre of the object? or.....?
For instance, given a pro grammatically drawn Sprite:
graphics.beginFill(0x000000);
graphics.moveTo(9.00000000,-7.00000000);
graphics.lineTo(13.00000000,0.00000000);
graphics.lineTo(9.00000000,6.00000000);
graphics.lineTo(-11.00000000,6.00000000);
graphics.lineTo(-14.00000000,0.00000000);
graphics.lineTo(-11.00000000,-7.00000000);
graphics.lineTo(9.00000000,-7.00000000);
graphics.endFill();
Where will sprite.x and sprite.y measure from?
The top left hand corner? Or center of the sprite? or...?
Please enlighten me, thank you guys!
Best Regards.
The origin is always the top left corner of the object. x grows positively towards right and negatively to left; y grows positively towards the bottom and negatively towards top.
0,0 ---- 5,0
| |
| |
| |
0,5 ---- 5,5
Thus the origin of stage/root object is top left corner of the SWF because its coordinates are 0,0. If you add a display object to the root object and set its x and y to 5, (mc.x = 5; mc.y = 5;), and draw a line on its local coordinates from 0,0 to 15,15 that line would be drawn from 5,5 to 20,20 on the global coordinates.
Check out localToGlobal and globalToLocal methods of the DisplayObject class.
I think your confusion comes from the layered nature of the coordinate systems in Flash. When you draw your Sprite, the x and y values you pass to the graphics methods (e.g. lineTo) are measured relative to the coordinate system of the sprites. Moving the sprite's .x and .y will move everything in the sprite's graphics. So, if the sprite was initially at (0,0) and ran the above code, much of the drawing is off the screen (because it draws to negative x and y values. If, after the above code was run, you moved the sprite to (14,7), all the lines would be visible (just barely).