最近在用WPF和C#,想做一个A4页面的编辑器(一个A4大小的JPG模板)
问题是,我想在 JPG 上的某个位置放置一些文本,并在我编写文本时能够看到它(如实时预览)。
这就是我现在取得的成就:
XAML
<Window x:Class="Tut.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Tut"
mc:Ignorable="d"
Title="Neshalet Logo ltd." Height="900" Width="1400">
<Border Padding="10">
<StackPanel Margin="0,10,0,0">
<Grid Height="839">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width=".3*"/>
</Grid.ColumnDefinitions>
<TextBlock Margin="0,2,22,817" HorizontalAlignment="Right" Grid.Column="2" FontSize="15">
בחר מוצר
</TextBlock>
<!-- Combo box for product type -->
<ComboBox x:Name="productType" Grid.Column="1" VerticalAlignment="Top" Height="25" Margin="10,0,17,0" >
<ComboBoxItem>באנרים</ComboBoxItem>
<ComboBoxItem>שקפים וניירות</ComboBoxItem>
<ComboBoxItem>וינילים</ComboBoxItem>
<ComboBoxItem>קשיחים הדפסה ישירה</ComboBoxItem>
<ComboBoxItem>הדבקה</ComboBoxItem>
</ComboBox>
<Image Source ="/Resources/a4.jpg" Grid.Column="0" Margin="10,35,0,0" HorizontalAlignment="Left" VerticalAlignment="Top">
</Image>
</StackPanel>
</Border>
问题是我让程序只在单击按钮时编写文本(如您所见Button_Click(),但我想在编写时显示我在SO Number文本框上写的文本。有没有办法在我编写文本而不是按钮单击事件时刷新窗口上的图像视图?
蓝山帝景
慕田峪9158850
相关分类