Have you had problems developing on a Virtual PC?

丶灬走出姿态 提交于 2019-12-11 01:48:42

问题


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

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

A simple example:

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);
            
        }
    }
}

Result:

Virtual PC                                  Real PC

alt text http://lh6.ggpht.com/_1TPOP7DzY1E/S45E8Ns3X0I/AAAAAAAADFE/3SROt2yQz_w/s800/Capture4.png

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


回答1:


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

Solutions:

  • Not use RDC, open your VM in VMWare/whatever
  • RDC does have settings , where you can disable some features, try enabling all of them / setting 'better' internet connection


来源:https://stackoverflow.com/questions/2370738/have-you-had-problems-developing-on-a-virtual-pc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!