C# 클래스 Smrf.WpfGraphicsLib.WpfGraphicsUtil

Utility methods for drawing with WPF.
All methods are static.
파일 보기 프로젝트 열기: 2014-sed-team3/term-project 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
Cosine30Degrees Double
Tangent30Degrees Double

공개 메소드들

메소드 설명
BitmapToBitmapSource ( System bitmap ) : System.Windows.Media.Imaging.BitmapSource
ColorToWpfColor ( System color ) : Color
ColorToWpfColor ( System color, Byte newAlpha ) : Color
CreateOnePixelPen ( Visual visual, System.Windows.Media.Brush brush ) : System.Windows.Media.Pen
DrawPixelAlignedRectangle ( System.Windows.Media.DrawingContext drawingContext, System.Windows.Media.Brush brush, System.Windows.Media.Pen pen, Rect rect ) : void
FontToTypeface ( System font ) : System.Windows.Media.Typeface
FreezeIfFreezable ( System.Windows.Freezable freezable ) : System.Boolean
GetAngleBetweenPointsRadians ( Point point1, Point point2 ) : Double
GetContrastingColor ( System color ) : Color
GetContrastingColor ( System color, System.Boolean useMaximumContrast ) : Color
GetDistanceBetweenPoints ( Point point1, Point point2 ) : Double
GetFarthestRectangleEdge ( Point point, Rect rectangle ) : RectangleEdge
GetFormattedTextBounds ( System.Windows.Media.FormattedText formattedText, Point origin ) : Rect
GetFormattedTextSize ( System.Windows.Media.FormattedText formattedText ) : Size
GetRectCenter ( System rect ) : Point
GetRectangleMinusMargin ( Rect rectangle, Double margin ) : Rect
GetRotatedMatrix ( Point centerOfRotation, Double angleToRotateDegrees ) : Matrix
GetScreenDpi ( Visual visual ) : Size
MovePointWithinBounds ( Point point, Rect boundingRectangle ) : Point
MoveRectangleWithinBounds ( Rect rectangle, Rect boundingRectangle, System.Boolean resizeRectangleIfNecessary ) : Rect
PointFToWpfPoint ( System pointF ) : Point
RectToRectangle ( System rect ) : System.Drawing.Rectangle
RectangleToRect ( System rectangle ) : Rect
SetTextBlockFont ( System.Windows.Controls.TextBlock textBlock, System font ) : void
SetWpfColorAlpha ( System color, Byte newAlpha ) : Color
SquareFromCenterAndHalfWidth ( System center, Double halfWidth ) : Rect
SwapPoints ( Point &point1, Point &point2 ) : void
SystemDrawingFontSizeToWpfFontSize ( Double windowsFormsFontSize ) : Double
TransformLength ( Double length, Transform transform, System.Boolean transformAlongX ) : Double
TriangleBoundsFromCenterAndHalfWidth ( System center, Double halfWidth ) : Rect
VisualToBitmap ( Visual visual, Int32 bitmapWidthPx, Int32 bitmapHeightPx ) : System.Drawing.Bitmap
WpfFontSizeToSystemDrawingFontSize ( Double wpfFontSize ) : Double
WpfPointToPoint ( System point ) : System.Drawing.Point
WpfToPx ( Double lengthWpf, Double screenDpi ) : Double

비공개 메소드들

메소드 설명
DeleteObject ( IntPtr hObject ) : System.Boolean
WpfGraphicsUtil ( ) : System

Static constructor for the WpfGraphicsUtil class.

메소드 상세

BitmapToBitmapSource() 공개 정적인 메소드

public static BitmapToBitmapSource ( System bitmap ) : System.Windows.Media.Imaging.BitmapSource
bitmap System
리턴 System.Windows.Media.Imaging.BitmapSource

ColorToWpfColor() 공개 정적인 메소드

public static ColorToWpfColor ( System color ) : Color
color System
리턴 System.Windows.Media.Color

ColorToWpfColor() 공개 정적인 메소드

public static ColorToWpfColor ( System color, Byte newAlpha ) : Color
color System
newAlpha Byte
리턴 System.Windows.Media.Color

CreateOnePixelPen() 공개 정적인 메소드

public static CreateOnePixelPen ( Visual visual, System.Windows.Media.Brush brush ) : System.Windows.Media.Pen
visual Visual
brush System.Windows.Media.Brush
리턴 System.Windows.Media.Pen

DrawPixelAlignedRectangle() 공개 정적인 메소드

public static DrawPixelAlignedRectangle ( System.Windows.Media.DrawingContext drawingContext, System.Windows.Media.Brush brush, System.Windows.Media.Pen pen, Rect rect ) : void
drawingContext System.Windows.Media.DrawingContext
brush System.Windows.Media.Brush
pen System.Windows.Media.Pen
rect System.Windows.Rect
리턴 void

FontToTypeface() 공개 정적인 메소드

public static FontToTypeface ( System font ) : System.Windows.Media.Typeface
font System
리턴 System.Windows.Media.Typeface

FreezeIfFreezable() 공개 정적인 메소드

public static FreezeIfFreezable ( System.Windows.Freezable freezable ) : System.Boolean
freezable System.Windows.Freezable
리턴 System.Boolean

GetAngleBetweenPointsRadians() 공개 정적인 메소드

public static GetAngleBetweenPointsRadians ( Point point1, Point point2 ) : Double
point1 Point
point2 Point
리턴 Double

GetContrastingColor() 공개 정적인 메소드

public static GetContrastingColor ( System color ) : Color
color System
리턴 System.Windows.Media.Color

GetContrastingColor() 공개 정적인 메소드

public static GetContrastingColor ( System color, System.Boolean useMaximumContrast ) : Color
color System
useMaximumContrast System.Boolean
리턴 System.Windows.Media.Color

GetDistanceBetweenPoints() 공개 정적인 메소드

public static GetDistanceBetweenPoints ( Point point1, Point point2 ) : Double
point1 Point
point2 Point
리턴 Double

GetFarthestRectangleEdge() 공개 정적인 메소드

public static GetFarthestRectangleEdge ( Point point, Rect rectangle ) : RectangleEdge
point Point
rectangle System.Windows.Rect
리턴 RectangleEdge

GetFormattedTextBounds() 공개 정적인 메소드

public static GetFormattedTextBounds ( System.Windows.Media.FormattedText formattedText, Point origin ) : Rect
formattedText System.Windows.Media.FormattedText
origin Point
리턴 System.Windows.Rect

GetFormattedTextSize() 공개 정적인 메소드

public static GetFormattedTextSize ( System.Windows.Media.FormattedText formattedText ) : Size
formattedText System.Windows.Media.FormattedText
리턴 System.Windows.Size

GetRectCenter() 공개 정적인 메소드

public static GetRectCenter ( System rect ) : Point
rect System
리턴 Point

GetRectangleMinusMargin() 공개 정적인 메소드

public static GetRectangleMinusMargin ( Rect rectangle, Double margin ) : Rect
rectangle System.Windows.Rect
margin Double
리턴 System.Windows.Rect

GetRotatedMatrix() 공개 정적인 메소드

public static GetRotatedMatrix ( Point centerOfRotation, Double angleToRotateDegrees ) : Matrix
centerOfRotation Point
angleToRotateDegrees Double
리턴 Matrix

GetScreenDpi() 공개 정적인 메소드

public static GetScreenDpi ( Visual visual ) : Size
visual Visual
리턴 System.Windows.Size

MovePointWithinBounds() 공개 정적인 메소드

public static MovePointWithinBounds ( Point point, Rect boundingRectangle ) : Point
point Point
boundingRectangle System.Windows.Rect
리턴 Point

MoveRectangleWithinBounds() 공개 정적인 메소드

public static MoveRectangleWithinBounds ( Rect rectangle, Rect boundingRectangle, System.Boolean resizeRectangleIfNecessary ) : Rect
rectangle System.Windows.Rect
boundingRectangle System.Windows.Rect
resizeRectangleIfNecessary System.Boolean
리턴 System.Windows.Rect

PointFToWpfPoint() 공개 정적인 메소드

public static PointFToWpfPoint ( System pointF ) : Point
pointF System
리턴 System.Windows.Point

RectToRectangle() 공개 정적인 메소드

public static RectToRectangle ( System rect ) : System.Drawing.Rectangle
rect System
리턴 System.Drawing.Rectangle

RectangleToRect() 공개 정적인 메소드

public static RectangleToRect ( System rectangle ) : Rect
rectangle System
리턴 System.Windows.Rect

SetTextBlockFont() 공개 정적인 메소드

public static SetTextBlockFont ( System.Windows.Controls.TextBlock textBlock, System font ) : void
textBlock System.Windows.Controls.TextBlock
font System
리턴 void

SetWpfColorAlpha() 공개 정적인 메소드

public static SetWpfColorAlpha ( System color, Byte newAlpha ) : Color
color System
newAlpha Byte
리턴 System.Windows.Media.Color

SquareFromCenterAndHalfWidth() 공개 정적인 메소드

public static SquareFromCenterAndHalfWidth ( System center, Double halfWidth ) : Rect
center System
halfWidth Double
리턴 System.Windows.Rect

SwapPoints() 공개 정적인 메소드

public static SwapPoints ( Point &point1, Point &point2 ) : void
point1 Point
point2 Point
리턴 void

SystemDrawingFontSizeToWpfFontSize() 공개 정적인 메소드

public static SystemDrawingFontSizeToWpfFontSize ( Double windowsFormsFontSize ) : Double
windowsFormsFontSize Double
리턴 Double

TransformLength() 공개 정적인 메소드

public static TransformLength ( Double length, Transform transform, System.Boolean transformAlongX ) : Double
length Double
transform System.Windows.Media.Transform
transformAlongX System.Boolean
리턴 Double

TriangleBoundsFromCenterAndHalfWidth() 공개 정적인 메소드

public static TriangleBoundsFromCenterAndHalfWidth ( System center, Double halfWidth ) : Rect
center System
halfWidth Double
리턴 System.Windows.Rect

VisualToBitmap() 공개 정적인 메소드

public static VisualToBitmap ( Visual visual, Int32 bitmapWidthPx, Int32 bitmapHeightPx ) : System.Drawing.Bitmap
visual Visual
bitmapWidthPx System.Int32
bitmapHeightPx System.Int32
리턴 System.Drawing.Bitmap

WpfFontSizeToSystemDrawingFontSize() 공개 정적인 메소드

public static WpfFontSizeToSystemDrawingFontSize ( Double wpfFontSize ) : Double
wpfFontSize Double
리턴 Double

WpfPointToPoint() 공개 정적인 메소드

public static WpfPointToPoint ( System point ) : System.Drawing.Point
point System
리턴 System.Drawing.Point

WpfToPx() 공개 정적인 메소드

public static WpfToPx ( Double lengthWpf, Double screenDpi ) : Double
lengthWpf Double
screenDpi Double
리턴 Double

프로퍼티 상세

Cosine30Degrees 공개적으로 정적으로 프로퍼티

public static Double Cosine30Degrees
리턴 Double

Tangent30Degrees 공개적으로 정적으로 프로퍼티

public static Double Tangent30Degrees
리턴 Double