Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/GuOrg/Gu.Wpf.Geometry


https://github.com/GuOrg/Gu.Wpf.Geometry

Last synced: 3 months ago
JSON representation

Awesome Lists containing this project

README

        

# Gu.Wpf.Geometry
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE.md)
[![Gitter](https://badges.gitter.im/JoinChat.svg)](https://gitter.im/GuOrg/Gu.Wpf.Geometry?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![NuGet](https://img.shields.io/nuget/v/Gu.Wpf.Geometry.svg)](https://www.nuget.org/packages/Gu.Wpf.Geometry/)
[![Build status](https://ci.appveyor.com/api/projects/status/1nk9elw89ker9fjs?svg=true)](https://ci.appveyor.com/project/JohanLarsson/gu-wpf-geometry)
[![Build Status](https://dev.azure.com/guorg/Gu.Wpf.Geometry/_apis/build/status/GuOrg.Gu.Wpf.Geometry?branchName=master)](https://dev.azure.com/guorg/Gu.Wpf.Geometry/_build/latest?definitionId=6&branchName=master)
[![ci](https://github.com/GuOrg/Gu.Wpf.Geometry/actions/workflows/ci.yml/badge.svg)](https://github.com/GuOrg/Gu.Wpf.Geometry/actions/workflows/ci.yml)

Small library with WPF geometries and shaders.

# Contents
- [Geometries](#geometries)
- [Balloon](#balloon)
- [BoxBalloon](#boxballoon)
- [Simple](#simple)
- [ConnectorAngle](#connectorangle)
- [ConnectorOffset](#connectoroffset)
- [With PlacementTarget](#with-placementtarget)
- [PlacementTarget](#placementtarget)
- [PlacementOptions](#placementoptions)
- [EllipseBalloon](#ellipseballoon)
- [GradientPath](#gradientpath)
- [Controls](#controls)
- [Zoombox](#zoombox)
- [Effects](#effects)
- [DesaturateEffect](#desaturateeffect)
- [FadeEffect](#fadeeffect)
- [MaskEffect](#maskeffect)
- [AngularGradientEffect](#angulargradienteffect)
- [HsvWheelEffect](#hsvwheeleffect)
- [HslWheelEffect](#hslwheeleffect)

# Geometries

## Balloon
A `ContentControl`for showing balloons.

Note: WPF Popup clips to bounds so the connector will be clipped when used in a popup.

```












```

![balloon](http://i.imgur.com/5BLZzJU.png)

## BoxBalloon
Draws a border with a connector.
Note: the connector is drawn outside the bounds of the element.

##### Simple

```xaml

```
![simple balloon](http://i.imgur.com/YZDjCvj.png)

##### ConnectorAngle
![connector angle](http://i.imgur.com/lwViiPI.png)

##### ConnectorOffset

![connector offset](http://i.imgur.com/hT1fFsj.png)

##### With PlacementTarget
```xaml














Auto
Auto 5
Auto -5
Center
Center 5
Center -5
Top Left
Top Center
Top Right
Bottom Left
Bottom Center
Bottom Right
Auto Center
Auto Left
Auto Right
Auto Top
Auto Bottom



```

![connected balloon](http://i.imgur.com/wJBJACc.gif)

##### With PlacementRectangle
```xaml














Auto
Auto 5
Auto -5
Center
Center 5
Center -5
Top Left
Top Center
Top Right
Bottom Left
Bottom Center
Bottom Right
Auto Center
Auto Left
Auto Right
Auto Top
Auto Bottom



```

![connected balloon](http://i.imgur.com/wJBJACc.gif)

##### With PlacementRectangle and PlacementTarget
```xaml














Auto
Auto 5
Auto -5
Center
Center 5
Center -5
Top Left
Top Center
Top Right
Bottom Left
Bottom Center
Bottom Right
Auto Center
Auto Left
Auto Right
Auto Top
Auto Bottom



```

![connected balloon](http://i.imgur.com/wJBJACc.gif)

##### PlacementTarget
The UIElement to connect the balloon to.

##### PlacementRectangle
The rectangle to connect the balloon to. If used with PlacementTarget, the rectangle coordinates are relative to it. If used alone, the coordinates are relative to the parent UIElement.

##### PlacementOptions
Where on the connected element the connector should be attached.

In xaml either input a string ``
Or use the `PlacementOptionsExtension`:
```xaml

```

## EllipseBalloon

Same API as BoxBalloon but renders:

![EllipseBallon](http://i.imgur.com/2yMYmfR.png)

## GradientPath

Based on [this blog post](http://www.charlespetzold.com/blog/2009/02/Graphical-Paths-with-Gradient-Colors.html)

```xaml


















```
![screenie](http://i.imgur.com/YxNoS87.gif)

# Controls

## Zoombox

Panel for zooming & panning. Handles touch but IsManipulationEnabled has default value `false` meaning no touch.

```xaml












```

# Effects
A collection of pixel shaders.

## DesaturateEffect
Desaturate an image, brush or WPF controls. It has only one property `Strength` 0 means the effect does nothing and 1 means a grayscale image is returned.

```xaml








```

## FadeEffect
Fade an image to a colour.

```xaml








```

## MaskEffect
Render an image as a selection mask.

```xaml







```

## AngularGradientEffect
A gradient that changes value along the angle. Perhaps useful for spinners.
Replaces the pixels of the owning element. The owning element must have a `Brush` set the brush can be any color that is not transparent.

### StartAngle
The angle for the `StartColor` -360 - 360 degrees, positive clockwise. Zero at 12 o'clock.

### CentralAngle
The anglular extent of the gradient -360 - 360 degrees, positive clockwise.

### CenterPoint
The center point of the gradient (0, 0) - (1, 1) default is (0.5, 0.5) fore a gradient around the center.

```xaml


























```

![animation](https://user-images.githubusercontent.com/1640096/33270557-c407bbdc-d384-11e7-9e81-03d5ab9f7b08.gif)

## HsvWheelEffect
A gradient that changes value along the angle. Perhaps useful for colour pickers.
Note that the element must have a background or fill. The brush can be any colour.

```xaml


















```

## HslWheelEffect
A gradient that changes value along the angle. Perhaps useful for colour pickers.
Note that the element must have a background or fill. The brush can be any colour.
Same API as HsvWheelEffect