你有没有问题,开发一个虚拟PC上?你有没有、问题、PC

2023-09-08 08:32:15 作者:深情不改轉身墜入死海

我使用虚拟个人电脑(远程桌面连接)为我的项目。 该项目使用了GDI +的功能。

I use a virtual PC (with remote desktop connection) for my project. The project uses some GDI+ functionality.

现在,显然存在一个问题,当显示图形的实际和虚拟PC上对象

Now, apparently there is a problem when displaying graphics object on the real and virtual PC.

一个简单的例子:

public class Form1 : Form 
{
    private void Form1_Paint(System.Object sender, 
                             System.Windows.Forms.PaintEventArgs e)
    {
        Graphics g = e.Graphics;
        
        using (Pen pen = new Pen(Color.Blue, 3)) {
            g.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias;
            g.DrawLine(pen, 10, 10, 50, 150);
            g.SmoothingMode = Drawing2D.SmoothingMode.None;
            g.DrawLine(pen, 30, 10, 70, 150);
            
        }
    }
}

结果:

Virtual PC                                  Real PC

所以,对于一个虚拟发展应采取的考虑。你有过类似的情况呢?

So, for a "virtual" development is should be take in consideration. Have you had the similar situations?

推荐答案

这是问题RDC,而不是与虚拟桌面。 RDC可以去除抗锯齿,例如,实现更低的数据传输。

This is problem with RDC, not with virtual desktop. RDC can remove antialiasing, for example, to achieve lower data transmission.

解决方案:

在不使用RDC,打开你的虚拟机在VMWare /不管 在RDC确实有设置,在这里你可以禁用某些功能,尽量让所有的人/设置更好的互联网连接