Packages
 In this topic

*Constructors

*Methods

 

Packages   PreviousThis PackageNext
Package com.ms.awt   Previous This
Package
Next

 


Class GraphicsX

public class GraphicsX extends FxGraphics implements 
            PeerConstants, PaintSurface
{
  // Constructors
  public GraphicsX(int hdc);

  // Methods
  public void drawCharsWithoutFxFont(char data[], int offset,
        int length, int x, int y, Rectangle optionRect,
        int options, int dx[], int dy[]);
  public void drawOutlinePolygon(int xOrig, int yOrig,
        OutlinePolygon op);
  public void drawPixels(int[] pels, int len);
  public void drawScanLines(boolean xChanging, int[] points,
        int offset, int nPoints);
  public void drawStringWithoutFxFont(String str,int x, int y,
        Rectangle optionRect, int options, int[] dx,int[] dy);
  public Device getDevice() throws DeviceException;
  public GlyphOutline getGlyphOutline(char ch);
  public int gethdc();
  public Point getTranslation();
  public void setTextBackgroundColor(Color c);
}

This class provides a graphics implementation specifically for the Microsoft VM. This class is not used directly in applets or applications, and is not cross-platform.

The following methods are methods implemented only for the Microsoft Virtual Machine. All other graphics methods are defined in FxGraphics and the java.awt.Graphics class.

FxGraphics
  |
  +--GraphicsX

Constructors

GraphicsX

public GraphicsX(int hdc);

Creates a graphics object for a user-supplied display context.

ParameterDescription
hdc The display context to create the graphics object for.

Methods

drawCharsWithoutFxFont

public void drawCharsWithoutFxFont(char data[], int offset, int length, int
        x, int y, Rectangle optionRect, int options, int dx[], int dy[]);

Uses a native peer graphics object to draw the given character array using the supplied advancement lists. This method is used by an FxFont object if it needs to be able to draw and then process a character array.

Return Value:

No return value.

ParameterDescription
str The string to draw.
x The x coordinate of the point where the string is drawn.
y The y coordinate of the point where the string is drawn.
optionRect The optional rectangle used for clipping and opaquing.
options The options for this method.
dx An array of destination x values.
dy An array of destination y values.

See Also: com.ms.fx.FxGraphics

drawOutlinePolygon

public void drawOutlinePolygon(int xOrig, int yOrig, OutlinePolygon op);

Draws an outline polygon.

Return Value:

No return value.

ParameterDescription
xOrig The horizontal starting point for the shape.
yOrig The vertical starting point for the shape.
op The OutlinePolygon to draw.

See Also: com.ms.fx.OutlinePolygon

drawPixels

public void drawPixels(int[] pels, int len);

Draws a given list of pixels.

Return Value:

No return value.

ParameterDescription
pels An array of pixels.
len The length of the array.

drawScanLines

public void drawScanLines(boolean xChanging, int[] points, int offset,
        int nPoints);

Draws fast lines, either horizontally or vertically.

Return Value:

No return value.

ParameterDescription
xChanging The direction that the line is drawn, either vertically or horizontally.
points An array of points.
offset The offset to use.
nPoints The number of points in the array.

drawStringWithoutFxFont

public void drawStringWithoutFxFont(String str,int x, int y,
        Rectangle optionRect, int options, int[] dx,int[] dy);

Uses a native peer graphics object to draw the given string using the supplied advancement lists. This method is used by an FxFont object if it needs to be able to draw and then process a string.

Return Value:

No return value.

ParameterDescription
str The string to draw.
x The x coordinate of the point where the string is drawn.
y The y coordinate of the point where the string is drawn.
optionRect The optional rectangle used for clipping and opaquing.
options The options for this method.
dx An array of destination x values.
dy An array of destination y values.

See Also: com.ms.fx.FxGraphics

getDevice

public Device getDevice() throws DeviceException;

Retrieves an an instance of a device class that the graphics object draws on.

Return Value:

Returns an instance of the either the DisplayDevice or the PrinterDevice class.

Exceptions:

com.ms.awt.DeviceException

getGlyphOutline

public GlyphOutline getGlyphOutline(char ch);

Retrieves the outline of a character in the currently selected font.

Note This method is obsolete. Use the FxOutlineFont class.

Return Value:

Returns an OutlinePolygon object. If the font is not an outline font, then null is returned.

ParameterDescription
ch The character whose outline is requested.

gethdc

public int gethdc();

Retrieves the Win32 display context handle. This is useful when the graphics object is used with a Microsoft DirectDraw surface, printer or ActiveX object (graphics objects created for components do not have consistent HDC values).

Return Value:

Returns the Win32 display context handle.

getTranslation

public Point getTranslation();

Retrieves the origin Point used in a translate operation on a graphics context, after the translation is complete.

Return Value:

Returns the origin for the translation.

setTextBackgroundColor

public void setTextBackgroundColor(Color c);

Sets the text background color. This is used for opaquing text.

Return Value:

No return value.

ParameterDescription
c The Color to set the text background to.

upnrm.gif © 1998 Microsoft Corporation. All rights reserved. Terms of use.