Java UpdatablePicture Example

说明

java updatablepicture示例是从最受好评的开源项目中提取的实现代码,你可以参考下面示例的使用方式。

编程语言: Java

类/类型: UpdatablePicture

示例#1
文件: RenderingTab.java项目: slav9nin/srcdemo2

 @SuppressWarnings("unused")
 private void updatePreviewEnabled() {
   previewEnabled = previewEnabledCheckbox.isChecked();
   getSettings().setPreviewEnabled(previewEnabled);
   if (!previewEnabled) {
     previewPicture.reset();
   }
   previewPicture.updatePicture();
 }

示例#2
文件: RenderingTab.java项目: slav9nin/srcdemo2

 private void updateUI() {
   lblLastFrameProcessed.setText(Integer.toString(framesProcessed.get()));
   lblFramesProcessedPerSecond.setText(framesProcessRate.getFormattedRate());
   lblLastFrameSaved.setText(Integer.toString(framesSaved.get()));
   if (previewEnabled) {
     previewPicture.updatePicture();
   }
   if (audioBufferInUse && parent.isAudioBufferInUse()) {
     switch (audioBufferStatus) {
       case REGULAR:
         audioBuffer.setMaximum(audioBufferTotal);
         audioBuffer.setValue(audioBufferOccupied);
         lblAudioBuffer1.setText(
             (audioBufferOccupied / 1024)
                 + Strings.lblRenderAudioBuffer1
                 + (audioBufferOccupied * 100 / audioBufferTotal)
                 + Strings.lblRenderAudioBuffer2);
         lblAudioBuffer2.setText(
             Strings.lblRenderAudioBuffer3
                 + (audioBufferTotal / 1024)
                 + Strings.lblRenderAudioBuffer4);
         btnFlushAudioBuffer.setText(Strings.btnRenderAudioBufferFlush);
         enabledAudioWidgets(audioBufferOccupied > 0 && audioBufferTotal > 0);
         break;
       case FLUSHING:
       case DESTROYED:
         audioBuffer.setMaximum(1);
         audioBuffer.setValue(0);
         btnFlushAudioBuffer.setEnabled(false);
         break;
     }
   } else {
     enabledAudioWidgets(false);
   }
 }

示例#3
文件: RenderingTab.java项目: slav9nin/srcdemo2

 @Override
 public void onFrameSaved(
     final File savedFrame, final int[] pixels, final int width, final int height) {
   framesSaved.incrementAndGet();
   if (previewEnabled && hasFocus) {
     previewPicture.push(pixels, width, height);
   }
 }

示例#4
文件: RenderingTab.java项目: slav9nin/srcdemo2

 private void onFocus() {
   hasFocus = true;
   if (previewEnabled) {
     previewPicture.restore();
   }
 }

示例#5
文件: RenderingTab.java项目: slav9nin/srcdemo2

 private void onDefocus() {
   hasFocus = false;
   if (previewEnabled) {
     previewPicture.reset();
   }
 }

展开阅读全文