Question: using C + + solve Problem 4 : The image box can be rotated and resized by dragging its upper - left or lower -

using C++ solve
Problem 4: The image box can be rotated and resized by dragging its upper-left or lower-right
corner. (Unlike when dragging the other two corners, the aspect ratio will be preserved.) Modify
the code in render_hw01 so that the image is placed in the image box, even after rotation, and is
zoomed and wrapped based on zoom and wrap_mode. See the second screenshot on the first page
of this assignment.
In a simple solution, and the one that is sufficient for full credit, the x and y loop limits and
increment are left unchanged. (That is, the for statements aren't changed.) As before, set box_wd
to the distance between points p 0 and p1 and box_ht to the distance between points p0 and p3, but
note that when the image box is rotated box_wd=p1.x-p0.x does not compute the correct distance
between p0 and p 1. The only other thing that needs to be done is to change how fb2x and fb-y
are computed. This simple solution will skip over some pixels, the pattern of skipped pixels varies
by rotation angle. That can be seen on the screenshot on the first page. Such a solution will get
full credit. The skipped pixels can be avoided by replacing the x,y loop nest with a loop nests that
iterate over frame buffer pixels of the rotated image box. That would be too tedious for a problem 4
on a first assignment.
 using C++ solve Problem 4: The image box can be rotated

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Programming Questions!