func (rs *ResourceSet) GetCursorTranslation(resID Identifier, langID uint16) (*Cursor, error) {
	data := rs.Get(RT_GROUP_CURSOR, resID, langID)
	if data == nil {
		return nil, errors.New(errGroupNotFound)
	}

	in := bytes.NewReader(data)
	dir := cursorDirHeader{}
	err := binaryRead(in, &dir)
	if err != nil || dir.Type != 2 || dir.Reserved != 0 {
		return nil, errors.New(errInvalidGroup)
	}

	g := &Cursor{}
	for i := 0; i < int(dir.Count); i++ {
		entry := cursorResDirEntry{}
		err := binaryRead(in, &entry)
		if err != nil {
			return nil, errors.New(errInvalidGroup)
		}
		img := rs.Get(RT_CURSOR, ID(entry.Id), rs.firstLang(RT_CURSOR, ID(entry.Id)))
		if img == nil {
			return nil, errors.New(errCursorMissing)
		}
		g.images = append(g.images, cursorImage{
			info:  entry.cursorInfo,
			image: img[4:],
			hotSpot: HotSpot{
				X: uint16(img[1])<<8 | uint16(img[0]),
				Y: uint16(img[3])<<8 | uint16(img[2]),
			},
		})
	}
	return g, nil
}
// GetCursorTranslation extracts a cursor from a specific language of the resource set.
GetCursorTranslation extracts a cursor from a specific language of the resource set.
// GetCursorTranslation extracts a cursor from a specific language of the resource set .
func (rs *ResourceSet) GetCursorTranslation(resID Identifier, langID uint16) (*Cursor, error) {
	data := rs.Get(RT_GROUP_CURSOR, resID, langID)
	if data == nil {
		return nil, errors.New(errGroupNotFound)
	}
	in := bytes.NewReader(data)
	dir := cursorDirHeader{}
	err := binaryRead(in, &dir)
	if err != nil || dir.Type != 2 || dir.Reserved != 0 {
		return nil, errors.New(errInvalidGroup)
	}
	g := &Cursor{}
	for i := 0; i < int(dir.Count); i++ {
		entry := cursorResDirEntry{}
		err := binaryRead(in, &entry)
		if err != nil {
			return nil, errors.New(errInvalidGroup)
		}
		img := rs.Get(RT_CURSOR, ID(entry.Id), rs.firstLang(RT_CURSOR, ID(entry.Id)))
		if img == nil {
			return nil, errors.New(errCursorMissing)
		}
		g.images = append(g.images, cursorImage{
			info:  entry.cursorInfo,
			image: img[4:],
			hotSpot: HotSpot{
				X: uint16(img[1])<<8 | uint16(img[0]),
				Y: uint16(img[3])<<8 | uint16(img[2]),
			},
		})
	}
	return g, nil
}
func ( rs * ResourceSet ) GetCursorTranslation ( resID Identifier , langID uint16 ) ( * Cursor , error ) { data := rs . Get ( RT_GROUP_CURSOR , resID , langID ) if data == nil { return nil , errors . New ( errGroupNotFound ) } in := bytes . NewReader ( data ) dir := cursorDirHeader { } err := binaryRead ( in , & dir ) if err != nil || dir . Type != 2 || dir . Reserved != 0 { return nil , errors . New ( errInvalidGroup ) } g := & Cursor { } for i := 0 ; i < int ( dir . Count ) ; i ++ { entry := cursorResDirEntry { } err := binaryRead ( in , & entry ) if err != nil { return nil , errors . New ( errInvalidGroup ) } img := rs . Get ( RT_CURSOR , ID ( entry . Id ) , rs . firstLang ( RT_CURSOR , ID ( entry . Id ) ) ) if img == nil { return nil , errors . New ( errCursorMissing ) } g . images = append ( g . images , cursorImage { info : entry . cursorInfo , image : img [ 4 : ] , hotSpot : HotSpot { X : uint16 ( img [ 1 ] ) << 8 | uint16 ( img [ 0 ] ) , Y : uint16 ( img [ 3 ] ) << 8 | uint16 ( img [ 2 ] ) , } , } ) } return g , nil }
GetCursorTranslation extracts a cursor from a specific language of the resource set.
GetCursorTranslation extracts a cursor from a specific language of the resource set .