How to make a resizeable rectangle selection tool?

前端 未结 4 532
夕颜
夕颜 2021-01-02 20:12

I\'m trying to write a very simple photo editor using C# 2008 or QT4.

How to make a resizeable rectangle selection tool like the photoshop did?

4条回答
  •  庸人自扰
    2021-01-02 21:08

    WPF Code Example: http://www.codeproject.com/KB/WPF/wpfmarchingants.aspx?display=Print

    This one is a bit more complicated because it involves image cropping, but if you scroll down to the selection rectangle, you can see the basic formulas for calculating the rectangle: http://69.10.233.10/KB/WPF/ImageCropper.aspx

    Lastly, another one using GDI: http://codelog.blogial.com/2008/10/31/rubber-band-selection-rectangle-in-c/

    If you provide more specifics, I'm sure we can help you out more.

提交回复
热议问题