网站首页  词典首页

请输入您要查询的函数:

 

术语 createpen
释义 CreatePen
语法:
HPEN CreatePen(
__in int fnPenStyle,
__in int nWidth,
__in COLORREF crColor
);
CreatePen函数
该CreatePen函数创建一个逻辑笔,具有指定的样式,宽度和颜色。笔随后可以选择到设备上下文,用于绘制直线和曲线。
参数
fnPenStyle [in]
笔式。它可以是任何下列值之一。
ValueMeaning
PS_SOLIDThe笔扎实。
PS_DASHThe笔破灭。这种风格是有效的只有当笔的宽度是一个或设备单位少。
PS_DOTThe笔点。这种风格是有效的只有当笔的宽度是一个或设备单位少。
PS_DASHDOTThe笔有交替划线和点。这种风格是有效的只有当笔的宽度是一个或设备单位少。
PS_DASHDOTDOTThe笔的交替和双点划线。这种风格是有效的只有当笔的宽度是一个或设备单位少。
PS_NULLThe笔是无形的。
PS_INSIDEFRAMEThe笔扎实。当这种笔在任何GDI的绘图功能,可以对一个边界矩形使用,图形的尺寸缩小,使之完全适合边界矩形,考虑到笔的宽度。这仅适用于几何笔。
nWidth [in]
笔的宽度,按逻辑单位。如果nWidth是零,笔是一个单一的像素宽,无论当前转变。
CreatePen返回具有指定样式与PS_SOLID位笔的宽度,如果您指定一个宽度比1以下样式:PS_DASH,PS_DOT,PS_DASHDOT,PS_DASHDOTDOT更大。
crColor [in]
一种颜色的笔颜色参考。要生成COLORREF结构,使用RGB宏。
返回值
如果函数成功,返回值是一个句柄,标识一个逻辑笔。
如果函数失败,返回值为NULL。
备注
之后,应用程序创建一个逻辑笔,可以选择该到设备上下文通过调用SelectObject函数笔。笔后选择到设备上下文,它可以用来绘制直线和曲线。
如果被nWidth参数指定的值为零,与创建的钢笔画线的始终是一个像素宽不论当前转型。
如果nWidth指定的值大于1的fnPenStyle参数必须PS_NULL,PS_SOLID,或PS_INSIDEFRAME。
如果nWidth指定的值大于1,fnPenStyle是PS_INSIDEFRAME,与笔相关的界线内的多边形,多义线以外的所有原语框架。
如果nWidth指定的值大于1,fnPenStyle是PS_INSIDEFRAME,以及由crColor参数指定的颜色不匹配的逻辑调色板项之一,该系统绘制使用抖动颜色线。色彩抖动不可用固体笔。
当您不再需要的笔,调用DeleteObject函数将其删除。
ICM的:没有色彩管理是建立完成。然而,色彩管理时执行笔是ICM的选择到一个启用的设备上下文。
实例
有关示例,请参阅创建彩色笔和刷子。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWingdi.h(头文件:winuser.h)
LibraryGdi32.lib
DLLGdi32.dll
参见
笔概述
笔功能
CreatePenIndirect
COLORREF
DeleteObject
ExtCreatePen
GetObject
的RGB
SelectObject
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月11日
==英文原文==CreatePen Function
The CreatePen function creates a logical pen that has the specified style, width, and color. The pen can subsequently be selected into a device context and used to draw lines and curves.
Syntax
HPEN CreatePen(
__in int fnPenStyle,
__in int nWidth,
__in COLORREF crColor
);
Parameters
fnPenStyle [in]
The pen style. It can be any one of the following values.
ValueMeaning
PS_SOLIDThe pen is solid.
PS_DASHThe pen is dashed. This style is valid only when the pen width is one or less in device units.
PS_DOTThe pen is dotted. This style is valid only when the pen width is one or less in device units.
PS_DASHDOTThe pen has alternating dashes and dots. This style is valid only when the pen width is one or less in device units.
PS_DASHDOTDOTThe pen has alternating dashes and double dots. This style is valid only when the pen width is one or less in device units.
PS_NULLThe pen is invisible.
PS_INSIDEFRAMEThe pen is solid. When this pen is used in any GDI drawing function that takes a bounding rectangle, the dimensions of the figure are shrunk so that it fits entirely in the bounding rectangle, taking into account the width of the pen. This applies only to geometric pens.

nWidth [in]
The width of the pen, in logical units. If nWidth is zero, the pen is a single pixel wide, regardless of the current transformation.
CreatePen returns a pen with the specified width bit with the PS_SOLID style if you specify a width greater than one for the following styles: PS_DASH, PS_DOT, PS_DASHDOT, PS_DASHDOTDOT.
crColor [in]
A color reference for the pen color. To generate a COLORREF structure, use the RGB macro.
Return Value
If the function succeeds, the return value is a handle that identifies a logical pen.
If the function fails, the return value is NULL.
Remarks
After an application creates a logical pen, it can select that pen into a device context by calling the SelectObject function. After a pen is selected into a device context, it can be used to draw lines and curves.
If the value specified by the nWidth parameter is zero, a line drawn with the created pen always is a single pixel wide regardless of the current transformation.
If the value specified by nWidth is greater than 1, the fnPenStyle parameter must be PS_NULL, PS_SOLID, or PS_INSIDEFRAME.
If the value specified by nWidth is greater than 1 and fnPenStyle is PS_INSIDEFRAME, the line associated with the pen is drawn inside the frame of all primitives except polygons and polylines.
If the value specified by nWidth is greater than 1, fnPenStyle is PS_INSIDEFRAME, and the color specified by the crColor parameter does not match one of the entries in the logical palette, the system draws lines by using a dithered color. Dithered colors are not available with solid pens.
When you no longer need the pen, call the DeleteObject function to delete it.
ICM: No color management is done at creation. However, color management is performed when the pen is selected into an ICM-enabled device context.
Examples
For an example, see Creating Colored Pens and Brushes .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWingdi.h (include Windows.h)
LibraryGdi32.lib
DLLGdi32.dll
See Also
Pens Overview
Pen Functions
CreatePenIndirect
COLORREF
DeleteObject
ExtCreatePen
GetObject
RGB
SelectObject
Send comments about this topic to Microsoft
Build date: 7/11/2009
==原始网址==http://msdn.microsoft.com/en-us/library/dd183509(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 13:20:25