public class ImageReplacedElement extends Object implements ReplacedElement
ReplacedElement that contains a Image. It's used as a
container for images included within XML being rendered. The image contained is immutable.| 限定符 | 构造器和说明 |
|---|---|
protected |
ImageReplacedElement() |
|
ImageReplacedElement(Image image,
int targetWidth,
int targetHeight)
Creates a new ImageReplacedElement and scales it to the size specified if either width or height has a valid
value (values are > -1), otherwise original size is preserved.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
detach(LayoutContext c) |
int |
getBaseline() |
Image |
getImage()
The image we're replacing.
|
int |
getIntrinsicHeight() |
int |
getIntrinsicWidth() |
Point |
getLocation()
Returns the current location where the element will be rendered on the canvas
|
boolean |
hasBaseline() |
boolean |
isRequiresInteractivePaint() |
void |
setLocation(int x,
int y)
Assigns the new locations where the element will be rendered.
|
protected Image _image
protected ImageReplacedElement()
public ImageReplacedElement(Image image, int targetWidth, int targetHeight)
image - An image.targetWidth - The width we'd like the image to have, in pixels.targetHeight - The height we'd like the image to have, in pixels.public void detach(LayoutContext c)
detach 在接口中 ReplacedElementpublic int getIntrinsicHeight()
getIntrinsicHeight 在接口中 ReplacedElementpublic int getIntrinsicWidth()
getIntrinsicWidth 在接口中 ReplacedElementpublic Point getLocation()
getLocation 在接口中 ReplacedElementpublic boolean isRequiresInteractivePaint()
isRequiresInteractivePaint 在接口中 ReplacedElementpublic void setLocation(int x,
int y)
setLocation 在接口中 ReplacedElementx - new horizontal posy - new vertical pospublic Image getImage()
public int getBaseline()
getBaseline 在接口中 ReplacedElementpublic boolean hasBaseline()
hasBaseline 在接口中 ReplacedElementCopyright © 2019. All Rights Reserved.