zoukankan      html  css  js  c++  java
  • C# GDI graphics.DrawImage 的参数问题

               graphics.DrawImage(imageSource,
                    new System.Drawing.Point[] {
                                    new System.Drawing.Point(1,1),
                                    new System.Drawing.Point(3, 1),
                                    new System.Drawing.Point(1, 3),
                            }
                );
                graphics.DrawImage(imageSource,
                    new System.Drawing.Point[] {
                                    new System.Drawing.Point(1,3),
                                    new System.Drawing.Point(3, 3),
                                    new System.Drawing.Point(1, 5),
                            }
                );

    对于如上代码,

    传入平行的点坐标,包含的点实际上每个都有3*3=9个点。

    实际绘制的点只有 (2,2),(5,5) 两个点

    所以如果要绘制到(1,1)(1,2)两个点需要这样设置参数

                graphics.DrawImage(imageSource,
                     new System.Drawing.Point[] {
                                                new System.Drawing.Point(-1,-1),
                                                new System.Drawing.Point(1, -1),
                                                new System.Drawing.Point(-1, 1),
                             }
                 );
                graphics.DrawImage(imageSource,
                    new System.Drawing.Point[] {
                                        new System.Drawing.Point(-1,0),
                                        new System.Drawing.Point(1, 0),
                                        new System.Drawing.Point(-1, 2),
                            }
                );
  • 相关阅读:
    数据源与连接池
    JavaBean
    JSP隐含对象
    kibana 报错 FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed
    JS中key-value存取
    JS判断数组中是否包含某个值
    数据库的事务
    net 查看版本号
    同行右边浮动
    CodeFirst
  • 原文地址:https://www.cnblogs.com/tanl/p/11411579.html
Copyright © 2011-2022 走看看