当我单击按钮打开文件时,该OpenFileDialog框打开两次.第一个框仅打开图像文件和第二个框文本文件.如果用户决定在不选择文件的情况下关闭第一个框,则也会弹出第二个框.我不确定我在这个问题上的看法.任何帮助,将不胜感激.谢谢!
OpenFileDialog of = new OpenFileDialog();
of.Filter = "All Image Formats|*.jpg;*.png;*.bmp;*.gif;*.ico;*.txt|JPG Image|*.jpg|BMP image|*.bmp|PNG image|*.png|GIF Image|*.gif|Icon|*.ico|Text File|*.txt";
if (of.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
try
{
image1.Source = new BitmapImage(new Uri(of.FileName));
// enable the buttons to function (previous page, next page, rotate left/right, zoom in/out)
button1.IsEnabled = false;
button2.IsEnabled = false;
button3.IsEnabled = false;
button4.IsEnabled = false;
button5.IsEnabled = true;
button6.IsEnabled = true;
button7.IsEnabled = true;
button8.IsEnabled = true;
}
catch (ArgumentException)
{
// Show messagebox when argument exception arises, when …Run Code Online (Sandbox Code Playgroud) 我想知道是否有人可以帮助我解决显示问题。我只想使用下面的代码允许顺时针旋转 90 度:
RotateTransform rotateTransform = new RotateTransform();
rotateTransform.CenterX = image1.Width / 2.0;
rotateTransform.CenterY = image1.Height / 2.0;
cW+= 90;
rotateTransform.Angle = cW;
TransformGroup transformGroup = new TransformGroup();
transformGroup.Children.Add(rotateTransform);
image1.RenderTransform = transformGroup;
Run Code Online (Sandbox Code Playgroud)
在 XAML 中,当我定义图像高度和宽度时,图像将旋转。但是,当设置为自动时,执行此代码后图像消失。为什么会发生这种情况,我该如何解决这个问题?任何帮助将不胜感激。
我很好奇如何从旧表中的四列复制数据并将数据放入新表中的两列中.我知道我可以将以下两个旧列用于一个新列.但是我如何为很多列做到这一点?
INSERT INTO new_table(new_column_xy)
(
SELECT old_column_x
FROM old_table
UNION ALL
SELECT old_column_y
FROM old_table
)
Run Code Online (Sandbox Code Playgroud)
以下是我想要完成的事情.
