Package com.ms.awt |
![]() Previous |
![]() Contents |
![]() 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); }
Encapsulates an extended graphics object.
public GraphicsX(Win32PrintJob pj);Creates a graphics object for a print job.
Parameter Description pj Print job which the object is created for.
public GraphicsX(GraphicsX g);Creates a graphics object based on another graphics object.
Parameter Description g The graphics object.
public GraphicsX(Win32Graphics g);Creates a graphics object based on another graphics object.
Parameter Description g The graphics object.
public GraphicsX(MComponentPeer comp);Creates a graphics object for a component.
Parameter Description comp Component for which the object will be created.
public GraphicsX(Win32Image image);Creates a graphics object for an off-screen image.
Parameter Description image Off-screen image for which the object will be created.
public int gethdc();Retrieves 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.
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 drawn. offset Offset of the first character in the data array to be drawn. length Number of characters to be drawn. x and y The x- and y-coordinates of the position where the first character will be drawn.
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 drawn. offset Offset of the first character in the data array to be drawn. length Number of characters to be drawn. x and y The x- and y-coordinates of the position where the first character will be drawn.
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 drawn. offset Offset of the first value in the data array to be drawn. length Number of characters to be drawn. x and y The x- and y-coordinates of the position where the first character will be drawn.
public void drawString(String str, int x, int y);Draws the given string.
Return Value:
No return value.
Parameter Description str String to be drawn. x and y The x- and y-coordinates of the position where the string will be drawn.
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 String to be drawn. x and y The x- and y-coordinates of the position where the string will be drawn.
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 drawn. offset Offset of the first value in the data array to be drawn. length Number of characters to be drawn. x and y The x- and y-coordinates of the position where the first character will be drawn.
public GlyphOutline getGlyphOutline(char ch);Retrieves 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 Character whose outline is requested.
public void drawOutlinePolygon(int xOrig, int yOrig, OutlinePolygon op);Draws an outline polygon.
Parameter Description xOrig Horizontal starting point for the shape. yOrig Vertical starting point for the shape. op Outline polygon to be drawn.
© 1997 Microsoft Corporation. All rights reserved. Legal Notices.