0

I have a task for my Computer Graphics classes. I have to create an application with the following features:

  1. There is a dolphin floating on the screen, the user can move it around,
  2. The dolphin is filled with some pattern;
  3. At the bottom, there are water waves, filled with some color, they move right and left;
  4. When the dolphin gets under the waves, the intersection of the dolphin and waves should be filled with some different color.

The task is about clipping. I should have my own functions: myFill, which takes as arguments Color and Polygon, and myClip, which takes two Polygons and returns their intersection. In myFill I should use scanlines this function has complexity O(1).

The main problem for me is - where to start? Should I use Windows Forms or WPF for this task? If I use WPF, Canvas (InkCanvas?) with some polygons how do I fill them then line by line? What classes will be helpful?

4

1 回答 1

0

建议你问问老师。WPF 和 Windows 窗体是“高级”图形库,内置提供多边形填充和剪切。你需要一些“低级”的东西,因为使用任何一个都会破坏作业的目的。

话虽如此,只要您避免使用高级别的东西,您就可以使用它们。在 WPF 中,您可以使用 WriteableBitmap 类来访问单个像素。在 WinForms 中,您可以使用 PictureBox 和 Bitmap 来获得相同的功能。

于 2013-05-18T12:20:05.757 回答