【问题标题】:Bitmap could not be found [duplicate]找不到位图[重复]
【发布时间】:2019-06-07 02:45:17
【问题描述】:

我正在使用 XAML 创建图形界面,但我遇到了位图类型的问题。尽管创建了 Bitmap 对象,但使用 System.Drawing 令人惊讶地没有使用。

using System;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Windows;
using Microsoft.Win32;

namespace Cryptography
{
    /// <summary>
    /// Logika interakcji dla klasy MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        private int NextStepCounter { get; set; }
        private Bitmap LoadedBitmap { get; set; }
        private Bitmap FirstShareBitmap { get; set; }
        private Bitmap SecondShareBitmap { get; set; }
        private Bitmap ThirdShareBitmap { get; set; }
        private Bitmap FourthShareBitmap { get; set; }
        private Bitmap LoadedFirstShareBitmap { get; set; }
        private Bitmap LoadedSecondShareBitmap { get; set; }
        private Bitmap LoadedThirdShareBitmap { get; set; }
        private Bitmap LoadedFourthShareBitmap { get; set; }
        private Bitmap OverlaidSharesBitmap { get; set; }

【问题讨论】:

  • 编译/构建代码时会发生什么?
  • CS0246 C# 找不到类型或命名空间名称“位图”(您是否缺少 using 指令或程序集引用?)

标签: c# xaml


【解决方案1】:

您需要从 Nuget 包安装 System.Drawing.Common

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-12-05
    • 2021-08-24
    • 1970-01-01
    • 2021-07-19
    • 1970-01-01
    • 1970-01-01
    • 2017-12-19
    • 1970-01-01
    相关资源
    最近更新 更多