m_sEdit1の座標点のデータを用いて枠の大きさを決定する。m_sEdit1のデータは文字列なので,整数値の座標点はistringstreamを用いて取り出す。そのために,ヘッダファイルに
#include
sstream
using namespace std;
を追加しておく。
| void CPaintDlg::OnLButtonUp(UINT nFlags, CPoint point) |
| { |
| drawLine=FALSE; |
| CDialog::OnLButtonUp(nFlags, point); |
| } |
| void CPaintDlg::OnLButtonUp(UINT nFlags, CPoint point) |
| { |
| drawLine=FALSE; |
| UpdateData(TRUE); |
| string st; |
| int xs, ys; |
| st = m_sEdit1; |
| istringstream is(st); |
| is |
| int xmax=xs, xmin=xs, ymax=ys, ymin=ys; |
| while(is |
| if(xs |
| xmax = xs; |
| } |
| if(xs |
| xmin = xs; |
| } |
| if(ys |
| ymax = ys; |
| } |
| if(ys |
| ymin = ys; |
| } |
| } |
| xmax = xmax + 2; |
| xmin = xmin - 2; |
| ymax = ymax + 2; |
| ymin = ymin - 2; |
| double bisectx = (xmax - xmin)/2.0; |
| double trisecty = (ymax - ymin)/3.0; |
| CDialog::OnLButtonUp(nFlags, point); |
| } |