Question: Using the Picture class from Worked Example 6.2, write a method: that superimposes two pictures, yielding a picture whose width and height are the larger

Using the Picture class from Worked Example 6.2, write a method:

public static Picture greenScreen (Picture picl, Picture pic2)

that superimposes two pictures, yielding a picture whose width and height are the larger of the widths and heights of pic1 and pic2. In the area where both pictures have pixels, use pic1, except when its pixels are green, in which case, you use pic2.

Data from worked example 6.2.

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

public static Picture greenScreen (Picture picl, Picture pic2)

Step by Step Solution

3.37 Rating (150 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Based on the provided information we need to write a method called greenScreen that takes two Picture objects pic1 and pic2 as parameters and superimp... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Java Programming Questions!