Задайте вопросЗадайте вопрос
 

ОтвеченоScroll text and images together question

  • 24 августа 2007 г. 12:19Willie007 Медали пользователяМедали пользователяМедали пользователяМедали пользователяМедали пользователя
     

    Hi,

    i have a question regarding text and images that need to be scrolling together.

    (like a ticker tape)

     

    In the past (windows forms) is created a usercontrol that made a bitmap that consists of text and images.

    this bitmap was copied to the visible part of the usercontrol.

     

    My qs now is how to tackle this in wpf. Should i create a bitmap as in the previous version, or is the current system so better that the best way is to use elements that are moved...

     

    Regards,

     

    Willie Jan

Ответы

  • 6 сентября 2007 г. 0:24Steve Galic - MSFTМодераторМедали пользователяМедали пользователяМедали пользователяМедали пользователяМедали пользователя
     Отвечено

     

    Are you looking for something like this:

     

    Code Snippet

    <Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <Border BorderBrush="Red" BorderThickness="2,2,2,2" CornerRadius="15,0,15,15" Canvas.Top="50" Canvas.Left="50" ClipToBounds="True" Width="300" Height="75">

     <Canvas Canvas.Top="60" Canvas.Left="60" Height="60">
     <Canvas.RenderTransform>
       <TranslateTransform X="300"/>
     </Canvas.RenderTransform>
     <Canvas.Triggers>
       <EventTrigger RoutedEvent="FrameworkElement.Loaded">
        <BeginStoryboard>
         <Storyboard>
          <DoubleAnimation Storyboard.TargetProperty="(Canvas.RenderTransform).(TranslateTransform.X)"  To="-700" RepeatBehavior="Forever" Duration="0:0:8" />
         </Storyboard>
        </BeginStoryboard>
       </EventTrigger>
     </Canvas.Triggers>

       <TextBlock>This is my looooooooooooooooooooooooooooooooooooooong scrolling text. It goes on and on and on</TextBlock>
       <Image Canvas.Left="570" Source="c:\image.jpg"/>
     </Canvas>

    </Border>

    </Canvas>

     

     

     

Все ответы