WPF工具是一个处理图形界面显示的开发工具。其中的很多功能都与图像处理相关。我们今天将要为大家介绍的是有关WPF Image的一些相关问题解疑。#t#
WPF Image一.Image是控件,Source属性类型是ImageSource
- < Image Source=
"xx.jpg" />
WPF Image二.ImageBrush是笔刷,用于填充
1.基本使用,必须指定ImageSource源
- < Rectangle
- < Rectangle.Fill>
- < ImageBrush
ImageSource="xx.jpg" />- < /Rectangle.Fill>
- < /Rectangle>
ImageBrush继承自TileBrush,ImageBrush功能比较强大
WPF Image三.ImageDrawing继承自Drawing,用于绘图
- < Button Content="Click Me">
- < Button.Background>
- < DrawingBrush>
- < DrawingBrush.Drawing>
- < ImageDrawing ImageSource="xx"
- Rect="50,50,50,50" />
- < /DrawingBrush.Drawing>
- < /DrawingBrush>
- < /Button.Background>
- < /Button>
WPF Image四.DrawingImage 是ImageSouce
- < Image>
- < Image.Source>
- < DrawingImage>
- < DrawingImage.Drawing>
- < GeometryDrawing>
- < GeometryDrawing.Geometry>
- < GeometryGroup>
- < EllipseGeometry Center="50,50"
RadiusX="45" RadiusY="20" />- < EllipseGeometry Center="50,50"
RadiusX="20" RadiusY="45" />- < /GeometryGroup>
- < /GeometryDrawing.Geometry>
- < GeometryDrawing.Brush>
- < LinearGradientBrush>
- < GradientStop Offset="0.0"
Color="Blue" />- < GradientStop Offset="1.0"
Color="#CCCCFF" />- < /LinearGradientBrush>
- < /GeometryDrawing.Brush>
- < GeometryDrawing.Pen>
- < Pen Thickness="10"
Brush="Black" />- < /GeometryDrawing.Pen>
- < /GeometryDrawing>
- < /DrawingImage.Drawing>
- < /DrawingImage>
- < /Image.Source>
- < /Image>
WPF Image相关概念总结就为大家介绍到这里。