问题:[问答题]
● 参考解析
intred=(x|y)&0xff;IMGonClick=over(this)title=放大=createImage(newMemoryImageSource(w,h,pix,0,w));g.drawImage(IMGonClick=over(this)title=放大,0,0,this);本题主要考查JavaApplet程序的设计。解答本题的关键是掌握MemoryImageSource(intwidth,intheight,intpixel[],intoffset,intscanLineWidth)方法的使用;其中width和height指明图像的大小,pixel中包含每个像素点的值,scanLineWidth指明图像中每行的像素数。在本题中,intred=(x|y)&0xff;语句的功能是定义变量red使其值为(x|y)&0xff,IMGonClick=over(this)title=放大=createImage(newMemoryImageSource(w,h,pix,0,w));语句的功能是生成图像,g.drawImage(IMGonClick=over(this)title=放大,0,0,this);语句的功能是在指定的Applet显示区内画出图像。