小编Ale*_* M.的帖子

为什么 Visual Studio 和任务管理器报告不同的内存使用情况?

我在 Visual Studio 中有一个程序正在调试。它旨在测试计算机的内存(并且方便地命名为RAM......)。

在调试时,该程序的内存使用量不断增加。无论如何,我已经使用 Visual Studio 诊断工具来监控使用量。然而,直到最近,我才打开任务管理器来查看它的详细信息;我所看到的让我困惑。RAM 使用量明显低于诊断工具显示的值。

任务管理器和诊断工具

谁能告诉我为什么会发生这种情况?

提前致谢。

vb.net visual-studio

5
推荐指数
1
解决办法
1959
查看次数

在位图上绘制长字符串会导致绘制问题

我正在将一个长字符串绘制到位图(通话超过一百万个字符),包括\r\n由a编写的多行字符StringBuilder

我的文本到位图的代码如下:

    public static Bitmap GetBitmap(string input, Font inputFont,
        Color bmpForeground, Color bmpBackground) {
        Image bmpText = new Bitmap(1, 1);
        try {
            // Create a graphics object from the image.
            Graphics g = Graphics.FromImage(bmpText);

            // Measure the size of the text when applied to image.
            SizeF inputSize = g.MeasureString(input, inputFont);

            // Create a new bitmap with the size of the text.
            bmpText = new Bitmap((int)inputSize.Width,
                (int)inputSize.Height);

            // Instantiate graphics object, again, since our bitmap
            // was …
Run Code Online (Sandbox Code Playgroud)

c# text bitmap

4
推荐指数
1
解决办法
433
查看次数

标签 统计

bitmap ×1

c# ×1

text ×1

vb.net ×1

visual-studio ×1