本文整理汇总了Java中java.awt.image.MemoryImageSource.setAnimated方法的典型用法代码示例。如果您正苦于以下问题:Java MemoryImageSource.setAnimated方法的具体用法?Java MemoryImageSource.setAnimated怎么用?Java MemoryImageSource.setAnimated使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.image.MemoryImageSource
的用法示例。
在下文中一共展示了MemoryImageSource.setAnimated方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: reset
import java.awt.image.MemoryImageSource; //导入方法依赖的package包/类
/**
* Resets the memory image source and byte backing array when the DFT point
* size has changed
*/
private void reset()
{
mPixels = new byte[ mDFTSize * mImageHeight ];
mMemoryImageSource = new MemoryImageSource( mDFTSize,
mImageHeight,
mColorModel,
mPixels,
0,
mDFTSize );
mMemoryImageSource.setAnimated( true );
mWaterfallImage = createImage( mMemoryImageSource );
repaint();
}
示例2: createGraphics
import java.awt.image.MemoryImageSource; //导入方法依赖的package包/类
void createGraphics() {
synchronized (imagSync) {
size = new Dimension(nChunks, nBins);
int width = nChunks;
int height = nBins;
screenBuffer = new int[width * height];
screenConverter = new MemoryImageSource(width, height,
screenBuffer, 0, width);
screenConverter.setAnimated(true);
screenConverter.setFullBufferUpdates(false);
offscreen = Toolkit.getDefaultToolkit()
.createImage(screenConverter);
setPreferredSize(size);
}
}
示例3: PgbIndexedVideoOutput
import java.awt.image.MemoryImageSource; //导入方法依赖的package包/类
public PgbIndexedVideoOutput(PgbVideo video) {
super(video);
// color model
packedScreenPalette = new byte[64 * 3];
mISrc = new MemoryImageSource(160, 144, new IndexColorModel(6, 64, packedScreenPalette, 0, false), video.getScreenMemory(), 0, 160);
mISrc.setAnimated(true);
mImg = createImage(mISrc);
packedBorderPalette = new byte[0x300];
borderColorModel = new IndexColorModel(8, 256, packedBorderPalette, 0, false);
//borderMISrc = new MemoryImageSource(256, 224, borderColorModel, borderPixels, 0, 256);
//borderMISrc.setAnimated(true);
//borderMImg = createImage(borderMISrc);
}
示例4: GameBoyPrinter
import java.awt.image.MemoryImageSource; //导入方法依赖的package包/类
public GameBoyPrinter() {
window = new GameBoyPrinterWindow("Game Boy Printer", IMAGE_WIDTH, IMAGE_HEIGHT);
//window.show();
bufferFillPos = 0;
bufferEmptyPos = 0;
dataSize = 640;
for (int r = 0; r < IMAGE_WIDTH * IMAGE_HEIGHT; r++) {
imageData[r] = 0xFF000000;
}
source = new MemoryImageSource(IMAGE_WIDTH, IMAGE_HEIGHT, new DirectColorModel(32, 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000),
imageData, 0, IMAGE_WIDTH);
source.setAnimated(true);
source.newPixels();
image = window.createImage(source);
window.setImage(image);
tileX = 0;
tileY = 1;
}
示例5: CutView
import java.awt.image.MemoryImageSource; //导入方法依赖的package包/类
/**
*
*/
public CutView()
{
image_data = new int[width * height];
source_top = new MemoryImageSource(width, height, image_data, 0, width);
source_top.setAnimated(true);
image_top = createImage(source_top);
source_bottom = new MemoryImageSource(width, height, image_data, 0, width);
source_bottom.setAnimated(true);
image_bottom = createImage(source_bottom);
BackgroundColor = new Color(0, 35, 110);
RedColor = new Color(255, 100, 100);
font = new Font("Tahoma", Font.PLAIN, 12);
setPreferredSize(new Dimension(350, 120));
setMaximumSize(new Dimension(350, 120));
setMinimumSize(new Dimension(350, 120));
setBackground(Color.black);
setVisible(true);
}
示例6: setPreviewSize
import java.awt.image.MemoryImageSource; //导入方法依赖的package包/类
/**
*
*/
public void setPreviewSize(int w, int h) {
if (!Common.getSettings().getBooleanProperty(Keys.KEY_Preview_fullScaled))
{
w = 512;
h = 288;
}
if (w == imageSizeMin[0] && h == imageSizeMin[1])
return;
imageSizeMin[0] = w;
imageSizeMin[1] = h;
Common.getMpvDecoderClass().setPreviewSize(w, h);
source = new MemoryImageSource(imageSizeMin[0], imageSizeMin[1], Common.getMpvDecoderClass().getPreviewPixel(), 0, imageSizeMin[0]);
source.setAnimated(true);
image = createImage(source);
source.newPixels();
}
示例7: ScanView
import java.awt.image.MemoryImageSource; //导入方法依赖的package包/类
/**
*
*/
public ScanView()
{
image_data = new int[width * height];
source_top = new MemoryImageSource(width, height, image_data, 0, width);
source_top.setAnimated(true);
image_top = createImage(source_top);
source_bottom = new MemoryImageSource(width, height, image_data, 0, width);
source_bottom.setAnimated(true);
image_bottom = createImage(source_bottom);
BackgroundColor = new Color(0, 35, 110);
RedColor = new Color(255, 100, 100);
font = new Font("Tahoma", Font.PLAIN, 14);
setLayout(new BorderLayout());
add(buildScanViewPanel(), BorderLayout.SOUTH);
setBackground(Color.black);
setVisible(true);
}
示例8: loadImage
import java.awt.image.MemoryImageSource; //导入方法依赖的package包/类
private void loadImage(int[] imageArray, int width, int height) {
if (imageArray != null) {
try {
scale = 1;
while ( (width * scale > maxResX && maxResX > 0) ||
(maxResY > 0 && height * scale > maxResY)) {
scale = scale * .9F;
}
if (scale < 1) {
System.out.println("Image scaled to " + (int) (scale * 100) +
"%, original resolution is " + width + " x " + height);
} else {
System.out.println("Image fully represented, resolution is " + width + " x " + height);
}
source = new MemoryImageSource(width, height, imageArray, 0, width);
source.setAnimated(true);
image = createImage(source);
}
catch (Exception e) {
e.printStackTrace();
}
}
}
示例9: ByteImage
import java.awt.image.MemoryImageSource; //导入方法依赖的package包/类
/**
* Constructs IntegerImage with the given ColorModel and data.
*
* @param colorModel
* @param data
*/
public ByteImage(ColorModel colorModel, byte[][] data) {
nrow = data.length;
ncol = data[0].length;
imagePixels = new byte[nrow * ncol];
for (int i = 0; i < nrow; i++) {
byte[] row = data[i];
System.arraycopy(row, 0, imagePixels, i * ncol, ncol);
}
imageSource = new MemoryImageSource(ncol, nrow,colorModel, imagePixels, 0, ncol);
imageSource.setAnimated(true);
image = Toolkit.getDefaultToolkit().createImage(imageSource);
dirtyImage=false;
xmin = 0;
xmax = ncol;
ymin = nrow;
ymax = 0; // zero is on top
}
示例10: IntegerImage
import java.awt.image.MemoryImageSource; //导入方法依赖的package包/类
/**
* Constructs IntegerImage with the given ColorModel and data.
*
* @param colorModel
* @param data
*/
public IntegerImage(ColorModel colorModel, int[][] data) {
if(colorModel==null)colorModel=ColorModel.getRGBdefault();
nrow = data.length;
ncol = data[0].length;
imagePixels = new int[nrow * ncol];
for (int i = 0; i < nrow; i++) {
int[] row = data[i];
System.arraycopy(row, 0, imagePixels, i * ncol, ncol);
}
imageSource = new MemoryImageSource(ncol, nrow,colorModel, imagePixels, 0, ncol);
imageSource.setAnimated(true);
image = Toolkit.getDefaultToolkit().createImage(imageSource);
dirtyImage=false;
xmin = 0;
xmax = ncol;
ymin = nrow;
ymax = 0; // zero is on top
}
示例11: Renderer
import java.awt.image.MemoryImageSource; //导入方法依赖的package包/类
public Renderer(City world, WorldMap worldMap, TrafficManager trafficManager, DisplaySettings displaySettings) {
this.world = world;
this.worldMap = worldMap;
this.trafficManager = trafficManager;
this.segmentsToRender = matchSegmentsToRender(worldMap.getSectionMapping(), trafficManager.getSegments());
this.displaySettings = displaySettings;
argbBuffer = new int[displaySettings.width * displaySettings.height];
screenCoordinatesToSegment = new Segment[argbBuffer.length];
screenCoordinatesToCellNo = new int[argbBuffer.length];
adjustScreenCoordinates();
clearBackground();
memoryImageSource = new MemoryImageSource(displaySettings.width, displaySettings.height, argbBuffer, 0, displaySettings.width);
memoryImageSource.setAnimated(true);
memoryImageSource.setFullBufferUpdates(false);
}
示例12: getImage
import java.awt.image.MemoryImageSource; //导入方法依赖的package包/类
public static BufferedImage getImage(int[] pixels, int width, int height){
ColorModel cm = ColorModel.getRGBdefault();
MemoryImageSource imageSource = new MemoryImageSource(width,height,cm,pixels,0,width);
imageSource.setAnimated(true);
Image temp = Toolkit.getDefaultToolkit().createImage(imageSource);
BufferedImage image = convertImage(temp);
return image;
}
示例13: setup
import java.awt.image.MemoryImageSource; //导入方法依赖的package包/类
public void setup(int w, int h, String nA, String nB)
{
showStatus("Loading image files...");
this.w = w;
this.h = h;
A = new int[h][w];
B = new int[h][w];
try
{
DataInputStream fA = new DataInputStream(new BufferedInputStream(
(new URL(nA)).openStream()));
DataInputStream fB = new DataInputStream(new BufferedInputStream(
(new URL(nB)).openStream()));
for (int i = 0; i < A.length; ++i)
for (int j = 0; j < A[0].length; ++j)
{
A[i][j] = fA.readShort();
B[i][j] = fB.readShort();
}
fA.close();
fB.close();
} catch (Exception ex)
{
ex.printStackTrace();
}
pic = new int[w * h];
is = new MemoryImageSource(w, h, pic, 0, w);
is.setAnimated(true);
ic.setImage(this.createImage(is));
ir = new ImageReg(A, B);
ir.getPicture(pic, false);
is.newPixels();
showStatus("Images loaded");
}
示例14: PgbDirectVideoOutput
import java.awt.image.MemoryImageSource; //导入方法依赖的package包/类
public PgbDirectVideoOutput(PgbVideo video, Applet a) {
super(video);
System.out.println("applet video!");
screenMemory = new int[160 * 144];
screenMISrc = new MemoryImageSource(160, 144, screenMemory, 0, 160);
screenMISrc.setAnimated(true);
screenMImg = a.createImage(screenMISrc);
}
示例15: View
import java.awt.image.MemoryImageSource; //导入方法依赖的package包/类
public View()
{
image_data = new int[width * height];
source = new MemoryImageSource(width, height, image_data, 0, width);
source.setAnimated(true);
image = createImage(source);
setPreferredSize(new Dimension(160, 90));
setMaximumSize(new Dimension(160, 90));
setMinimumSize(new Dimension(160, 90));
setBackground(Color.black);
}