如何在头像上拖放图像

时间:2014-02-27 15:06:23

标签: c# xaml windows-store-apps visual-studio-2013

我是开发Windows 8商店应用的新手。任何人都可以帮助我创建简单的代码,根据在visual studio中使用c#for windows store app给出的图像将红布拖到正文上。谢谢

                                                                                          

    <Grid Grid.Column="1" Name="gridTop">
        <Grid HorizontalAlignment="Center" Width="600" >
            <Canvas Grid.Column="1" Margin="0, 295,9,0" HorizontalAlignment="Left" Height="295" Name="canvas1" VerticalAlignment="Top" RenderTransformOrigin="0.5,0.5">
                <Canvas.RenderTransform>
                    <ScaleTransform x:Name="canvasArmario_scale" ScaleX="1.5" ScaleY="1.5" />
                </Canvas.RenderTransform>
                <ListView x:Name="listView" HorizontalAlignment="Left" Height="172" Grid.Row="1" VerticalAlignment="Top" Width="181" Canvas.Left="198" Canvas.Top="48" CanDragItems="True" DragLeave="dragleave"   >
                    <Image x:Name="image1"  Height="166" Width="155" Source="/Imagens/Boy/boy1.png" ManipulationMode="All" RenderTransformOrigin="0.5,0.5" >
                        <Image.RenderTransform>
                            <CompositeTransform/>
                        </Image.RenderTransform>
                    </Image>
                    <Image x:Name="image2" Height="166" Width="155" Source="/Imagens/Boy/boy2.png"  ManipulationMode="All" />
                    <Image x:Name="image3"  Height="166" Width="155" Source="/Imagens/Boy/boy3.png"  ManipulationMode="All" />
                    <Image x:Name="image4" Height="166" Width="155" Source="/Imagens/Boy/boy4.png"  ManipulationMode="All" /> 
         </ListView> 
        </Canvas>
        </Grid>
    </Grid>

这是c#代码

    private void dragleave(object sender, DragEventArgs e)
    {

    }

我尝试在列表视图中拖动图像并放入画布中的图像。但我不知道我应该在函数dragleave中写什么。如果不理解,请随时再问我。

0 个答案:

没有答案