Direct2D Draw and Fill

---恢复内容开始---

画线:

ID2D1RenderTarget::DrawLine

virtual void DrawLine(
                  D2D1_POINT_2F point0,//起点
                  D2D1_POINT_2F point1,//终点
  [in]            ID2D1Brush *brush,
                  FLOAT strokeWidth = 1.0f,//线条粗细
  [in, optional]  ID2D1StrokeStyle *strokeStyle = NULL//可省略
) = 0;

椭圆:

struct D2D1_ELLIPSE {
  D2D1_POINT_2F point;
  FLOAT         radiusX;
  FLOAT         radiusY;
};

矩形:

圆角矩形:

struct D2D1_ROUNDED_RECT {
  D2D1_RECT_F rect;
  FLOAT       radiusX;
  FLOAT       radiusY;
};

画轮廓:

ID2D1RenderTarget::DrawEllipse

void DrawEllipse(
  [ref]           const D2D1_ELLIPSE &ellipse,
  [in]            ID2D1Brush *brush,
                  FLOAT strokeWidth = 1.0f,
  [in, optional]  ID2D1StrokeStyle *strokeStyle = NULL
);

ID2D1RenderTarget::DrawRectangle

void DrawRectangle(
  [ref]           const D2D1_RECT_F &rect,
  [in]            ID2D1Brush *brush,
                  FLOAT strokeWidth = 1.0f,
  [in, optional]  ID2D1StrokeStyle *strokeStyle = NULL
);

ID2D1RenderTarget::DrawRoundedRectangle

void DrawRoundedRectangle(
  [ref]           const D2D1_ROUNDED_RECT &roundedRect,
  [in]            ID2D1Brush *brush,
                  FLOAT strokeWidth = 1.0f,
  [in, optional]  ID2D1StrokeStyle *strokeStyle = NULL
);

填充:

ID2D1RenderTarget::FillEllipse

void FillEllipse(
  [ref]  const D2D1_ELLIPSE &ellipse,
  [in]   ID2D1Brush *brush
);

ID2D1RenderTarget::FillRectangle 

void FillRectangle(
  [ref]  const D2D1_RECT_F &rect,
  [in]   ID2D1Brush *brush
);

ID2D1RenderTarget::FillRoundedRectangle

void FillRoundedRectangle(
  [ref]  const D2D1_ROUNDED_RECT &roundedRect,
  [in]   ID2D1Brush *brush
);

---恢复内容结束---

时间: 2024-08-07 05:24:36

Direct2D Draw and Fill的相关文章

pygame.draw.line

import traceback import math import pygame from pygame.locals import * pygame.display.init() pygame.font.init() sizes = { "screen" : ( 300, 480 ) } colors = { "line" : ( 255, 255, 255 ), "rect" : ( 100, 100, 100 ), "circ

Direct2D 第5篇 绘制图像

原文:Direct2D 第5篇 绘制图像 我加载的图像是一张透明底PNG图像,背景使用渐变的绿色画刷 #include <windows.h> #include <d2d1.h> #include <d2d1helper.h> #include <dwrite.h> #pragma comment(lib, "dwrite.lib") #pragma comment(lib, "d2d1.lib") #include

使用Java2D改善API的绘制效果

---------------siwuxie095 工程名:TestSwingPaintAPI 包名:com.siwuxie095.swingpaint 类名:SwingPaintAPI.java(主类).MyPanel.java 向 com.siwuxie095.swingpaint 包中放入图像文件:img.png 工程结构目录如下: SwingPaintAPI.java(主类): package com.siwuxie095.swingpaint; import java.awt.Bord

GDI+编程小结

GDI+(Graphics Device Interface Plus图形设备接口加)是Windows XP和Windows Server 2003操作系统的子系统,也是.NET框架的重要组成部分,负责在屏幕和打印机上绘制图形图像和显示信息. GDI+不但在功能上比GDI 要强大很多,而且在代码编写方面也更简单,因此会很快成为Windows图形图像程序开发的首选. 一.              GDI+的特点和新增功能 GDI+与GDI一样,都具有设备无关性.应用程序的程序员可利用GDI+这样

可视化工具solo show-----Prefuse自带例子GraphView讲解

2014.10.15日以来的一个月,挤破了头.跑断了腿.伤透了心.吃够了全国最大餐饮连锁店——沙县小吃.其中酸甜苦辣,绝不是三言两语能够说得清道的明的.校招的兄弟姐妹们,你们懂得…… 体会最深的一句话还是:出来混,迟早要还的. 一个月过去了,迷茫之际有太多无奈,无奈中又夹杂些许庆幸,岁月匆匆,人生不息,奋斗不止. 遵守最初的诺言,继续走我可视化的道路: 上集摘要:一个月博文中大概介绍了可视化的一些常用工具,从可操作性.实用性.交互性等各方面进行了简单的对比和总结,具体参见http://www.c

微信小程序开发—(八)canvas绘制图形

一.小知识 (1).API接口 (2).context 对象的方法列表 二.步骤 wxml中: <canvas canvas-id="myCanvas" class="myCanvas" ></canvas> 在js文件onLoad: function() {}的方法中开始编写代码 1.创建一个 Canvas 绘图上下文 CanvasContext const ctx = wx.createCanvasContext('myCanvas')

Swing绘图API

----------------siwuxie095 工程名:TestSwingPaintAPI 包名:com.siwuxie095.swingpaint 类名:SwingPaintAPI.java(主类).MyPanel.java 向 com.siwuxie095.swingpaint 包中放入图像文件:img.png 工程结构目录如下: SwingPaintAPI.java(主类): package com.siwuxie095.swingpaint; import java.awt.Bor

Java 2D API - 2. Graphics 入门

Java 2D API强大而复杂,不过大多时候我们只需使用java.awt.Graphcis类的部分功能.下面的内容将覆盖大多数的常见应用. Graphics 类中的方法大致可以分为两类: Draw and fill方法,用于绘制基本的图形.文本和图像: 属性设置方法,用于控制绘制和填充的效果.setFont()和setColor()等方法就属于这类方法. 下图显示这些方法和图像的对应关系: 1. drawString() 用于绘制文本: g.drawString("Hello", 1

SVG.js 引用获取整理

一.SVG.get() 根据id获取元素 var draw = SVG('svg1').size(300, 300); var circle = draw.circle(50); circle.fill('red').move(10, 10); //添加类 circle.addClass('circle'); //设置ID circle.id('circle'); //SVG.get() 获取Element对象 var circle2 = SVG.get('circle'); console.i