import Graphics ; import Graphics2D ; import GUI ; // グラフィックスデータとレンダラーの生成 int graphicsID = newGraphics( ) ; int rendererID = newGraphics2DRenderer( 800, 500, graphicsID ) ; // 表示画面の生成 int windowID = newWindow( 0, 0, 800, 500, "Hello 2DCG !" ) ; int labelID = newImageLabel( 0, 0, 800, 500, graphicsID ) ; mountComponent( labelID, windowID ); // ラスターデータを作成 int red[ 500 ][ 800 ] ; int green[ 500 ][ 800 ] ; int blue[ 500 ][ 800 ] ; int alpha[ 500 ][ 800 ] ; red = 0 ; green = 0 ; blue = 0 ; alpha = 255 ; for( int i=0; i<500; i++ ){ for( int j=0; j<800; j++ ){ if( j < 500 && i < 300 ){ red[ i ][ j ] = 255 ; } if( 200 < j && j < 600 && 100 < i && i < 400 ){ green[ i ][ j ] = 255 ; } if( 300 < j && 200 < i ){ blue[ i ][ j ] = 255 ; } } } //ラスターデータの内容を描画 setPixel( rendererID, red, green, blue, alpha ) ; // GUI の描画 paintComponent( labelID ) ; paintComponent( windowID ) ;