网站首页  词典首页

请输入您要查询的函数:

 

术语 extcreatepen
释义 ExtCreatePen
语法:
HPEN ExtCreatePen(
__in DWORD dwPenStyle,
__in DWORD dwWidth,
__in const LOGBRUSH *lplb,
__in DWORD dwStyleCount,
__in const DWORD *lpStyle
);
ExtCreatePen功能
该ExtCreatePen函数创建一个合乎逻辑的化妆品或几何笔,具有指定的样式,宽度和刷属性。
参数
dwPenStyle [in]
一种类型,风格的结合,端盖,并加入属性。从每个类别中的值是通过结合使用按位或运算符(|)。
笔类型可以是下列值之一。
ValueMeaning
PS_GEOMETRICThe笔几何。
PS_COSMETICThe笔化妆品。
笔风格可以是下列值之一。
ValueMeaning
PS_ALTERNATEThe笔集所有其他像素。 (这种风格是仅适用于化妆品笔。)
PS_SOLIDThe笔扎实。
PS_DASHThe笔破灭。
PS_DOTThe笔点。
PS_DASHDOTThe笔有交替划线和点。
PS_DASHDOTDOTThe笔的交替和双点划线。
PS_NULLThe笔是无形的。
PS_USERSTYLEThe笔使用样式阵列由用户提供。
PS_INSIDEFRAMEThe笔扎实。当这种笔在任何GDI的绘图功能,可以对一个边界矩形使用,图形的尺寸缩小,使之完全适合边界矩形,考虑到笔的宽度。这仅适用于几何笔。
端盖只指定几何笔。最终上限可以是下列值之一。
ValueMeaning
PS_ENDCAP_ROUNDEnd上限是圆形。
PS_ENDCAP_SQUAREEnd帽的广场。
PS_ENDCAP_FLATEnd上限为平地。
联接是唯一指定的几何笔。该连接可以是下列值之一。
ValueMeaning
PS_JOIN_BEVELJoins的斜面。
PS_JOIN_MITERJoins是斜接时,他们属于在SetMiterLimit函数设置当前的上限。如果超出这个限制,联接斜面。
PS_JOIN_ROUNDJoins是圆形。
dwWidth [in]
笔的宽度。如果dwPenStyle参数PS_GEOMETRIC,宽度给出了逻辑单位。如果dwPenStyle是PS_COSMETIC,宽度必须设置为1。
lplb [in]
一个 LOGBRUSH结构的指针。如果dwPenStyle是PS_COSMETIC的lbColor成员指定笔的颜色和lpStyle成员必须设置为BS_SOLID。如果dwPenStyle是PS_GEOMETRIC,所有成员都必须用于指定刷属性笔。
dwStyleCount [in]
的长度,以双字节值单位,在lpStyle数组。此值必须为零,如果dwPenStyle不是PS_USERSTYLE。
风格数被限制为16。
lpStyle [in]
对一个数组的指针。第一个值指定在用户第一次划线长度定义的风格,第二个值指定了第一次太空长度等。该指针必须为NULL,如果dwPenStyle不是PS_USERSTYLE。
如果lpStyle阵列线绘制过程中超出指针被重置为数组的开始。当这种情况发生,并dwStyleCount是偶数,是划线和空格重复模式。但是,如果dwStyleCount是奇数,模式颠倒当指针重置-在lpStyle现在的第一个元素是指空格,第二个是指破折号,等等。
返回值
如果函数成功,返回值是一个句柄,标识一个逻辑笔。
如果函数失败,返回值是零。
备注
阿几何笔可以有任何的宽度,可以有一个如dithers和图案画笔,任何属性。阿美容笔只能是一个像素宽,必须有一个坚实的颜色,但一般化妆品笔笔比几何速度。
一个几何笔宽度总是在世界指定单位。一个化妆品笔宽度总是1。
端盖,并加入只有指定的几何笔。
之后,应用程序创建一个逻辑笔,可以选择该到设备上下文通过调用SelectObject函数笔。笔后选择到设备上下文,它可以用来绘制直线和曲线。
如果dwPenStyle是PS_COSMETIC和PS_USERSTYLE,在lpStyle数组项指定风格单位长度短划线和空格。阿式单位的定义是在笔是用来画线的设备。
如果dwPenStyle是PS_GEOMETRIC和PS_USERSTYLE,在lpStyle数组项指定划线和逻辑单位空间的长度。
如果dwPenStyle是PS_ALTERNATE,风格单位被忽略,所有其他像素设置。
如果LOGBRUSH结构lbStyle成员指向lplb是BS_PATTERN,位图指出该结构lbHatch成员不能是DIB的部分。一个DIB节是由CreateDIBSection创建一个位图。如果是的DIB位图节,ExtCreatePen函数失败。
当应用程序不再需要指定的笔,它应该调用DeleteObject函数删除笔。
ICM的:没有色彩管理是在半岛建立完成。然而,色彩管理时执行笔是ICM的选择到一个启用的设备上下文。
实例
有关示例,请参阅使用钢笔。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWingdi.h(头文件:winuser.h)
LibraryGdi32.lib
DLLGdi32.dll
参见
笔概述
笔功能
CreateDIBSection
CreatePen
CreatePenIndirect
DeleteObject
GetObject
LOGBRUSH
SelectObject
SetMiterLimit
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月11日
==英文原文==ExtCreatePen Function
The ExtCreatePen function creates a logical cosmetic or geometric pen that has the specified style, width, and brush attributes.
Syntax
HPEN ExtCreatePen(
__in DWORD dwPenStyle,
__in DWORD dwWidth,
__in const LOGBRUSH *lplb,
__in DWORD dwStyleCount,
__in const DWORD *lpStyle
);
Parameters
dwPenStyle [in]
A combination of type, style, end cap, and join attributes. The values from each category are combined by using the bitwise OR operator ( | ).
The pen type can be one of the following values.
ValueMeaning
PS_GEOMETRICThe pen is geometric.
PS_COSMETICThe pen is cosmetic.

The pen style can be one of the following values.
ValueMeaning
PS_ALTERNATEThe pen sets every other pixel. (This style is applicable only for cosmetic pens.)
PS_SOLIDThe pen is solid.
PS_DASHThe pen is dashed.
PS_DOTThe pen is dotted.
PS_DASHDOTThe pen has alternating dashes and dots.
PS_DASHDOTDOTThe pen has alternating dashes and double dots.
PS_NULLThe pen is invisible.
PS_USERSTYLEThe pen uses a styling array supplied by the user.
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.

The end cap is only specified for geometric pens. The end cap can be one of the following values.
ValueMeaning
PS_ENDCAP_ROUNDEnd caps are round.
PS_ENDCAP_SQUAREEnd caps are square.
PS_ENDCAP_FLATEnd caps are flat.

The join is only specified for geometric pens. The join can be one of the following values.
ValueMeaning
PS_JOIN_BEVELJoins are beveled.
PS_JOIN_MITERJoins are mitered when they are within the current limit set by the SetMiterLimit function. If it exceeds this limit, the join is beveled.
PS_JOIN_ROUNDJoins are round.

dwWidth [in]
The width of the pen. If the dwPenStyle parameter is PS_GEOMETRIC, the width is given in logical units. If dwPenStyle is PS_COSMETIC, the width must be set to 1.
lplb [in]
A pointer to a LOGBRUSH structure. If dwPenStyle is PS_COSMETIC, the lbColor member specifies the color of the pen and the lpStyle member must be set to BS_SOLID. If dwPenStyle is PS_GEOMETRIC, all members must be used to specify the brush attributes of the pen.
dwStyleCount [in]
The length, in DWORD units, of the lpStyle array. This value must be zero if dwPenStyle is not PS_USERSTYLE.
The style count is limited to 16.
lpStyle [in]
A pointer to an array. The first value specifies the length of the first dash in a user-defined style, the second value specifies the length of the first space, and so on. This pointer must be NULL if dwPenStyle is not PS_USERSTYLE.
If the lpStyle array is exceeded during line drawing, the pointer is reset to the beginning of the array. When this happens and dwStyleCount is an even number, the pattern of dashes and spaces repeats. However, if dwStyleCount is odd, the pattern reverses when the pointer is reset -- the first element of lpStyle now refers to spaces, the second refers to dashes, and so forth.
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 zero.
Remarks
A geometric pen can have any width and can have any of the attributes of a brush, such as dithers and patterns. A cosmetic pen can only be a single pixel wide and must be a solid color, but cosmetic pens are generally faster than geometric pens.
The width of a geometric pen is always specified in world units. The width of a cosmetic pen is always 1.
End caps and joins are only specified for geometric pens.
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 dwPenStyle is PS_COSMETIC and PS_USERSTYLE, the entries in the lpStyle array specify lengths of dashes and spaces in style units. A style unit is defined by the device where the pen is used to draw a line.
If dwPenStyle is PS_GEOMETRIC and PS_USERSTYLE, the entries in the lpStyle array specify lengths of dashes and spaces in logical units.
If dwPenStyle is PS_ALTERNATE, the style unit is ignored and every other pixel is set.
If the lbStyle member of the LOGBRUSH structure pointed to by lplb is BS_PATTERN, the bitmap pointed to by the lbHatch member of that structure cannot be a DIB section. A DIB section is a bitmap created by CreateDIBSection . If that bitmap is a DIB section, the ExtCreatePen function fails.
When an application no longer requires a specified pen, it should call the DeleteObject function to delete the pen.
ICM: No color management is done at pen creation. However, color management is performed when the pen is selected into an ICM-enabled device context.
Examples
For an example, see Using Pens .
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
CreateDIBSection
CreatePen
CreatePenIndirect
DeleteObject
GetObject
LOGBRUSH
SelectObject
SetMiterLimit
Send comments about this topic to Microsoft
Build date: 7/11/2009
==原始网址==http://msdn.microsoft.com/en-us/library/dd162705(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 11:25:28