wx-0.12.1.4: wxHaskell

Portabilityportable
Stabilityprovisional
Maintainerwxhaskell-devel@lists.sourceforge.net

Graphics.UI.WX.Draw

Contents

Description

Drawing.

A Device Context or DC, is an instance of Drawn, Brushed, Literate, and Colored.

Synopsis

Classes

Types

type DC a = WxObject (CDC a)

Pointer to an object of type DC, derived from WxObject.

type Bitmap a = GDIObject (CBitmap a)

Pointer to an object of type Bitmap, derived from GDIObject.

Drawing

circle :: DC a -> Point -> Int -> [Prop (DC a)] -> IO ()Source

Draw a circle given a center point and radius.

arc :: DC a -> Point -> Int -> Double -> Double -> [Prop (DC a)] -> IO ()Source

Draw an arc of a circle. Takes the center of the circle, its radius and a starting and ending point relative to the three-o'clock position. Angles are in degrees and positive values denote a counter clockwise motion. If the angles are equal, an entire circle is drawn.

ellipse :: DC a -> Rect -> [Prop (DC a)] -> IO ()Source

Draw an ellipse, bounded by a certain rectangle.

ellipticArc :: DC a -> Rect -> Double -> Double -> [Prop (DC a)] -> IO ()Source

Draw an elliptic arc. Takes the bounding rectangle, and a starting and ending point relative to the three-o'clock position from the center of the rectangle. Angles are in degrees and positive values denote a counter clockwise motion. If the angles are equal, an entire ellipse is drawn.

line :: DC a -> Point -> Point -> [Prop (DC a)] -> IO ()Source

Draw a line.

polyline :: DC a -> [Point] -> [Prop (DC a)] -> IO ()Source

Draw a polyline.

polygon :: DC a -> [Point] -> [Prop (DC a)] -> IO ()Source

Draw a polygon. The polygon is filled with the odd-even rule. Note that the polygon is automatically closed.

drawPoint :: DC a -> Point -> [Prop (DC a)] -> IO ()Source

Draw a single point.

drawRect :: DC a -> Rect -> [Prop (DC a)] -> IO ()Source

Draw a rectangle.

roundedRect :: DC a -> Rect -> Double -> [Prop (DC a)] -> IO ()Source

Draw a rectangle with rounded corners. The corners are quarter circles with the given radius. If radius is positive, the value is assumed to be the radius of the rounded corner. If radius is negative, the absolute value is assumed to be the proportion of the smallest dimension of the rectangle. This means that the corner can be a sensible size relative to the size of the rectangle, and also avoids the strange effects X produces when the corners are too big for the rectangle.

drawText :: DC a -> String -> Point -> [Prop (DC a)] -> IO ()Source

Draw text.

rotatedText :: DC a -> String -> Point -> Double -> [Prop (DC a)] -> IO ()Source

Draw rotated text. Takes an angle in degrees relative to the three-o'clock position.

drawBitmap :: DC a -> Bitmap () -> Point -> Bool -> [Prop (DC a)] -> IO ()Source

Draw a bitmap. Takes a bitmap, a point and a boolean that is True when the bitmap is drawn with a transparency mask.

drawImage :: DC a -> Image b -> Point -> [Prop (DC a)] -> IO ()Source

Draw an image.

Internal

dcWith :: DC a -> [Prop (DC a)] -> IO b -> IO bSource

dcClear :: DC a -> IO ()

usage: (dcClear obj).