首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏c#Winform自定义控件系列

    (六十五)c#Winform自定义控件-思维导图/组织架构图(工业)

    PointF(item.ParentItem.DrawRectangle.Right+12,item.ParentItem.DrawRectangle.Top+item.ParentItem.DrawRectangle.Height -12,item.DrawRectangle.Top+item.DrawRectangle.Height/2), 40 new PointF(item.DrawRectangle.Left,item.DrawRectangle.Top+item.DrawRectangle.Height/2), 41 PointF(item.ParentItem.DrawRectangle.Right+12,item.ParentItem.DrawRectangle.Top+item.ParentItem.DrawRectangle.Height PointF(item.DrawRectangle.Left,item.DrawRectangle.Top+item.DrawRectangle.Height/2), 287

    2.6K20发布于 2019-09-29
  • 来自专栏明志德到的IT笔记

    C#设计模式10——外观模式的写法

    下面我们来看一个简单的C#外观模式的示例代码: 首先我们需要定义一个门面接口: public interface IShapeFacade { void DrawCircle(); void DrawRectangle public void DrawCircle() { Console.WriteLine("Drawing a circle..."); } public void DrawRectangle Rectangle : IShapeFacade { public void DrawCircle() { //空实现 } public void DrawRectangle class Triangle : IShapeFacade { public void DrawCircle() { //空实现 } public void DrawRectangle (); } } 在客户端代码中,我们只需要创建一个ShapeMaker对象,并调用它的DrawCircle、DrawRectangle和DrawTriangle方法即可: 代码运行结果如下: Drawing

    36130编辑于 2023-10-21
  • 来自专栏全栈程序员必看

    wxpython自定义控件_wxPython 教程(十三) 自定义控件

    (0, 0, full, 30) dc.SetPen(wx.Pen(‘#ffafaf’)) dc.SetBrush(wx.Brush(‘#ffafaf’)) dc.DrawRectangle(full, 0, till-full, 30) else: dc.SetPen(wx.Pen(‘#FFFFB8’)) dc.SetBrush(wx.Brush(‘#FFFFB8’)) dc.DrawRectangle (10, i*4, 30, 5) dc.DrawRectangle(41, i*4, 30, 5) else: dc.SetBrush(wx.Brush(‘#36ff27’)) dc.DrawRectangle dc.DrawRectangle(41, i*4, 30, 5) else: dc.SetBrush(wx.Brush(‘#36ff27’)) dc.DrawRectangle(10, i*4, 30 , 5) dc.DrawRectangle(41, i*4, 30, 5) 这里我们绘制了 40 个矩形,每列 20 个。

    2K20编辑于 2022-08-26
  • 来自专栏阿飞的学习记录

    23种设计模式之开闭原则

    graphicEditor = new GraphicEditor(); graphicEditor.drawCircle(new Circle()); graphicEditor.drawRectangle type,来绘制不同的图形 */ public void drawShape(Shape s) { if (s.m_type == 1) { drawRectangle (s); } else if (s.m_type == 2) { drawShape(s); } } public void drawRectangle type,来绘制不同的图形 */ public void drawShape(Shape s) { if (s.m_type == 1) { drawRectangle drawShape(s); }else if (s.m_type==3){ drawShape(s); } } public void drawRectangle

    35810编辑于 2022-03-23
  • 来自专栏全栈程序员必看

    【ArcGIS二次开发】鹰眼的实现「建议收藏」

    ESRI.ArcGIS中不存在类型或命名空间”的错误 解决方法如下: 右击解决方案中的引用,打开添加引用 选择缺少的程序集,点击确定 2、添加定义声明变量,添加SynchronizeEagleEye方法、DrawRectangle EagleEyeMapControl.Extent = mainMapControl.FullExtent; pEnv = mainMapControl.Extent as IEnvelope; DrawRectangle (pEnv); EagleEyeMapControl.ActiveView.Refresh(); } } //在鹰眼地图上面画矩形框 private void DrawRectangle SynchronizeEagleEye(); } 4、设置MainMapControl控件的OnExtentUpdated属性的功能,在OnExtentUpdated中添加DrawRectangle pEnv.Offset(Dx, Dy); //根据偏移量更改 pEnv 位置 pMoveRectPoint.PutCoords(e.mapX, e.mapY); DrawRectangle

    1.6K11编辑于 2022-09-15
  • 来自专栏ATYUN订阅号

    开发者都应该了解的SOLID原则(下)

    来看如下接口IShape: 1interface IShape { 2 drawCircle(); 3 drawSquare(); 4 drawRectangle(); 5} 这个接口可以画圆形 Circle类,Square类,Rectangel类实现IShape接口的时候必须定义drawCircle(),drawSqure(),drawRectangle()方法。 如果我们向Ishape中增加一个接口,如drawTriangle(): 1interface IShape { 2 drawCircle(); 3 drawSquare(); 4 drawRectangle 5 drawCircle(); 6} 7interface ISquare { 8 drawSquare(); 9} 10interface IRectangle { 11 drawRectangle { 22 drawSquare() { 23 //... 24 } 25} 26class Rectangle implements IRectangle { 27 drawRectangle

    79020发布于 2019-07-05
  • 来自专栏历史专栏

    【愚公系列】2024年01月 GDI+绘图专题 Region

    , 50, 130, 50);Region reg = new Region(rect1);reg.Intersect(rect2);g.FillRegion(Brushes.Red, reg);g.DrawRectangle (Pens.Blue, rect1);g.DrawRectangle(Pens.LimeGreen, rect2);在这个示例中,我们创建了两个矩形,然后使用它们创建了两个Region对象。 (Pens.Blue, rect1);g.DrawRectangle(Pens.LimeGreen, rect2);执行以上代码,会在画布上绘制一个包含两个矩形的新矩形。 (Pens.Blue, rect1);g.DrawRectangle(Pens.LimeGreen, rect2);在以上代码中,首先创建了两个矩形区域region1和region2,并将它们进行异或集操作 (Pens.Blue, rect1);g.DrawRectangle(Pens.LimeGreen, rect2);上面的代码中,首先创建了两个矩形区域region1和region2,然后调用region2

    81321编辑于 2024-01-05
  • 来自专栏历史专栏

    【愚公系列】2024年01月 GDI+绘图专题(裁剪、变换、重绘)

    graphics = e.Graphics; // 绘制矩形 Rectangle rect = new Rectangle(10, 10, 100, 100); graphics.DrawRectangle 接着,我们调用Graphics对象的ScaleTransform方法进行缩放,并使用DrawLine和DrawRectangle方法绘制了一条直线和一个矩形。 下面是一个简单的示例代码: //创建一个Graphics对象 Graphics g = e.Graphics; g.DrawRectangle(Pens.Red, 10, 10, 50, 50); 如果要将绘图对象移动到新的位置,应该使用其他的绘图方法或属性,例如DrawRectangle方法中的x和y参数。 ; //调用ScaleTransform方法进行缩放 g.RotateTransform(45); //绘制图形 g.DrawLine(Pens.Black, 0, 0, 100, 100); g.DrawRectangle

    1.3K11编辑于 2024-01-11
  • 来自专栏Java爬坑系列

    【Go语言绘图】图片的旋转

    TestRotateImage(t *testing.T) { width := 1000 height := 1000 dc := gg.NewContext(width, height) dc.DrawRectangle := im.Bounds().Size().Y width := 2 * w height := 2 * h dc := gg.NewContext(width, height) dc.DrawRectangle dc.DrawRectangle(0, 0, float64(2*h), float64(2*w)) dc.SetRGB255(255, 255, 0) dc.Fill() 顺便纠正一下上一篇中的遗漏的点 := im.Bounds().Size().Y width := 2 * w height := 2 * h dc := gg.NewContext(width, height) dc.DrawRectangle := im.Bounds().Size().Y width := 2 * w height := 2 * h dc := gg.NewContext(width, height) dc.DrawRectangle

    3.7K20发布于 2020-12-18
  • 来自专栏A周立SpringCloud

    谈谈 SOLID 原则

    让我们看下面的IShape接口: interface IShape { drawCircle(); drawSquare(); drawRectangle(); } 该接口有绘制正方形 实现IShape接口的Circle,Square或Rectangle类必须同时实现drawCircle(),drawSquare(),drawRectangle()方法,如下所示: class Circle implements IShape { drawCircle(){ //... } drawSquare(){ //... } drawRectangle Rectangle类实现了它没有使用的方法(drawCircle和drawSquare),同样Square类实现了drawCircle和drawRectangle方法,Circle类也实现了drawSquare 如果我们向IShape接口添加另一个方法,例如drawTriangle(), interface IShape { drawCircle(); drawSquare(); drawRectangle

    75500发布于 2020-03-06
  • 来自专栏程序员

    OpenCV画直线,画圆,画椭圆,画矩形,绘制文字

    include<opencv2/opencv.hpp> using namespace std; using namespace cv; void drawLine(Mat &image); void drawRectangle (Mat& image); int main() { Mat MyBG = imread("C:/Users/zhou_/Desktop/1.png"); drawLine(MyBG); drawRectangle image表示在哪儿画,p1,p2是线段的端点,color是线的颜色,3代表线的粗细,LINE_AA表示反走样 line(image, p1, p2, color,3,LINE_AA); } void drawRectangle

    4.5K10发布于 2020-03-18
  • 来自专栏菩提树下的杨过

    objective-C 的代码文件组织

    %@",bounds.x,bounds.y,bounds.width,bounds.height,colorName(fillColor)); }//drawCircle //画矩形 void drawRectangle rectangle at (%d,%d,%d,%d) in %@",bounds.x,bounds.y,bounds.width,bounds.height,colorName(fillColor)); }//drawRectangle case kCircle: drawCircle(shapes[i].bounds,shapes[i].fillColor); break; case kRectangle: drawRectangle

    89070发布于 2018-01-22
  • 来自专栏飞鸟的专栏

    设计模式-桥接模式示例

    this.width = width; this.height = height; } @Override public void draw() { drawingAPI.drawRectangle 绘图API的接口public interface DrawingAPI { void drawCircle(double x, double y, double radius); void drawRectangle , %f) with radius %f using standard drawing API\n", x, y, radius); } @Override public void drawRectangle circle at (%f, %f) with radius %f using OpenGL API\n", x, y, radius); } @Override public void drawRectangle

    36030编辑于 2023-05-04
  • 来自专栏菩提树下的杨过

    objective-C 的Hello World!

    in %@",bounds.x,bounds.y,bounds.width,bounds.height,colorName(fillColor)); }//drawCircle //画矩形 void drawRectangle rectangle at (%d,%d,%d,%d) in %@",bounds.x,bounds.y,bounds.width,bounds.height,colorName(fillColor)); }//drawRectangle case kCircle: drawCircle(shapes[i].bounds,shapes[i].fillColor); break; case kRectangle: drawRectangle

    71690发布于 2018-01-22
  • 来自专栏GIS二次开发基础

    # 如何使用 ArcGIS Engine10.2 + C# VS2012 开发环境,实现鹰眼功能。

    这样它们就可以在同一个坐标系统下显示,最后我们获取了主地图的当前范围,作为一个 IEnvelope 对象,并将其作为参数传递给 DrawRectangle 方法,用于在鹰眼地图上绘制一个矩形框,表示主地图的当前视图范围 = axMapControl1.FullExtent; pEnv = axMapControl1.Extent as IEnvelope; DrawRectangle (pEnv); axMapControl2.ActiveView.Refresh(); } } 我们还需要定义一个 DrawRectangle 方法,用于在鹰眼地图上绘制一个矩形框,表示当前地图的视图范围,用DrawRectangle 方法接受一个 IEnvelope 参数,表示当前地图的视图范围的几何形状。 代码如下: //在鹰眼地图上面画矩形框 private void DrawRectangle(IEnvelope pEnvelope) {

    3K10编辑于 2023-04-20
  • 来自专栏PHP修行之路

    【php设计模式】门面模式

    } public function drawCircle(){ $this->circle->draw(); } public function drawRectangle square->draw(); } } $shapemark = new shapemark(); $shapemark->drawCircle();//画一个圆形 $shapemark->drawRectangle

    87021发布于 2019-06-17
  • 来自专栏林德熙的博客

    win10 uwp 求两个矩形相连的几何

    move, new Size(10, 10)); 可以看到矩形 1 是固定的,但是矩形2会安装鼠标的左上角作为矩形,所以可以通过鼠标看自己的方法是否符合 先将两个矩形画出来 ds.DrawRectangle (rect1, Colors.IndianRed); ds.DrawRectangle(rect2, new Color() { Canvas_Draw(ICanvasAnimatedControl sender, CanvasAnimatedDrawEventArgs args) { var cl = DrawRectangle ds.DrawImage(cl, new Vector2(10, 10)); } } private CanvasCommandList DrawRectangle (rect1, Colors.IndianRed); ds.DrawRectangle(rect2, new Color() {

    64820发布于 2019-03-13
  • 来自专栏个人路线

    dart设计模式之外观模式

    Rectangle(); square = new Square(); } ​ void drawCircle() { circle.draw(); } ​ void drawRectangle main() { ShapeMaker shapeMaker = new ShapeMaker(); shapeMaker.drawCircle(); shapeMaker.drawRectangle

    31700发布于 2021-08-07
  • 软件工程设计原理开放封闭原则举例

    java复制代码class GraphicEditor { public void drawShape(Shape s) { if (s.type == 1) drawRectangle else if (s.type == 2) drawCircle(s); // 每当添加新的图形时,都需要修改这个方法 } public void drawRectangle

    31310编辑于 2024-03-27
  • 来自专栏小鹏的专栏

    简单的人脸跟踪

    rects(index).row; cddBoxW = rects(index).width; cddBoxH = rects(index).height; imgCpy = DrawRectangle rects(index).row; cddBoxW = rects(index).width; cddBoxH = rects(index).height; imgCpy = DrawRectangle

    92970发布于 2018-01-09
领券