Exemplo n.º 1
0
func NewNullPen() *Pen {
	lb := w32.LOGBRUSH{LbStyle: w32.BS_NULL}

	hPen := w32.ExtCreatePen(w32.PS_COSMETIC|w32.PS_NULL, 1, &lb, 0, nil)
	if hPen == 0 {
		panic("failed to create null brush")
	}

	return &Pen{hPen: hPen}
}
Exemplo n.º 2
0
func NewPen(style uint, width uint, brush *Brush) *Pen {
	if brush == nil {
		panic("Brush cannot be nil")
	}

	hPen := w32.ExtCreatePen(style, width, brush.GetLOGBRUSH(), 0, nil)
	if hPen == 0 {
		panic("Failed to create pen")
	}

	return &Pen{hPen, style, brush}
}