Package com.ms.awt |
![]() Previous |
![]() Microsoft Packages |
![]() Index |
![]() Next |
public class GraphicsX extends Win32Graphics { // Constructors public GraphicsX(Win32PrintJob pj); public GraphicsX(GraphicsX g); public GraphicsX(Win32Graphics g); public GraphicsX(MComponentPeer comp); public GraphicsX(Win32Image image); // Methods public int gethdc(); public void setFont(Font font); public void drawChars(char data[], int offset, int length, int x, int y); public int drawCharsWidth(char data[], int offset, int length, int x, int y); public void drawBytes(byte data[], int offset, int length, int x, int y); public void drawString(String str, int x, int y); public int drawStringWidth(String str, int x, int y); public int drawBytesWidth(byte data[], int offset, int length, int x, int y); public GlyphOutline getGlyphOutline(char ch); public void drawOutlinePolygon(int xOrig, int yOrig, OutlinePolygon op); }
A class then encapsulates an extended graphics object
public GraphicsX(Win32PrintJob pj)Create a graphics object for a print job.
Parameter Description pj The print job. See Also: Win32PrintJob
public GraphicsX(GraphicsX g)Create a graphics object based on another graphics object.
Parameter Description g The graphics object.
public GraphicsX(Win32Graphics g)Create a graphics object based on another graphics object.
Parameter Description g The graphics object. See Also: Win32Graphics
public GraphicsX(MComponentPeer comp)Create a graphics object for a component.
Parameter Description comp The component. See Also: MComponentPeer
public GraphicsX(Win32Image image)Create a graphics object for an off-screen image.
Parameter Description image The off-screen image. See Also: Win32Image
public int gethdc()Retrieve the Win32 display context handle.
Return Value:
Returns the display context handle.
public void setFont(Font font)Sets the font for all subsequent text-drawing operations.
Parameter Description font The specified font. See Also: Font
public void drawChars(char data[], int offset, int length, int x, int y)Draws the given character array.
Return Value:
No return value.
Parameter Description data Characters to be draw. offset Offset of the first character in the data array to be drawn. length Number of characters to draw. x and y The position to draw the first character.
public int drawCharsWidth(char data[], int offset, int length, int x, int y)Draws the given character array and returns the width in pixels of all characters drawn.
Return Value:
Returns the width. If font is not set, returns -1.
Parameter Description data Characters to be draw. offset Offset of the first character in the data array to be drawn. length Number of characters to draw. x and y The position to draw the first character.
public void drawBytes(byte data[], int offset, int length, int x, int y)Draws the given byte array.
Return Value:
No return value.
Parameter Description data Byte values of characters to be draw. offset Offset of the first value in the data array to be drawn. length Number of characters to draw. x and y The position to draw the first character.
public void drawString(String str, int x, int y)Draws the given string.
Return Value:
No return value.
Parameter Description str The string to draw. x and y The position to draw the string.
public int drawStringWidth(String str, int x, int y)Draws the given string and returns the length of the drawn string in pixels.
Return Value:
Returns the width. If font is not set, returns -1.
Parameter Description str The string to draw. x and y The position to draw the string.
public int drawBytesWidth(byte data[], int offset, int length, int x, int y)Draws the given character array and return the width in pixels.
Return Value:
Returns the width. If font is not set, returns -1.
Parameter Description data Byte values of characters to be draw. offset Offset of the first value in the data array to be drawn. length Number of characters to draw. x and y The position to draw the first character.
public GlyphOutline getGlyphOutline(char ch)Gets the outline of a character in the currently selected font.
Return Value:
Returns an OutlinePolygon object. If the font is not an outline font, returns null.
Parameter Description ch The character whose outline is requested.
public void drawOutlinePolygon(int xOrig, int yOrig, OutlinePolygon op)Draws an outline polygon.
Parameter Description xOrig The horizontal starting point for the shape. yOrig The vertical starting point for the shape. op The outline polygon.