|
|
Nan
|
public class NanMagnifier : NanObj
The NanMagnifier type exposes the following members.
| Name | Description | |
|---|---|---|
| NanMagnifier | NanMagnifier 클래스의 기본 생성자로서, 멤버변수에 대하여 초기화를 수행한다. |
| Name | Description | |
|---|---|---|
| CalcRange | 객체의 최소, 최대 범위를 계산한다. (Overrides NanObjCalcRange) | |
| Clone | 객체를 복사한다. (Overrides NanObjClone) | |
| GetGuideLineType | 연결선 옵션을 가져온다. | |
| Set | 확대영역 이미지의 영역을 설정한다. | |
| SetBackColor |
Background 색을 설정한다.
(Overrides NanObjSetBackColor(Color)) | |
| SetForeColor |
Foreground 색을 설정한다.
(Overrides NanObjSetForeColor(Color)) | |
| SetGuideLineType | 연결선 옵션을 설정한다. | |
| SetLineColor |
선 색을 설정한다.
(Overrides NanObjSetLineColor(Color)) | |
| SetLineStyle |
선 스타일을 설정한다.
(Overrides NanObjSetLineStyle(eLineStyle, DoubleCollection)) | |
| SetLineThick |
선 두께를 설정한다.
(Overrides NanObjSetLineThick(Double)) | |
| SetMagnifiedImage | 정의된 delegate 함수에서 BitmapImage를 가져와서 확대주기의 이미지로 셋팅한다. | |
| SetMagnifiedImageDelegate | 확대영역을 가져오기 위한 delegate 함수를 설정한다. | |
| SetThickUnit |
도형의 선 굵기 단위(world 좌표 단위)를 설정한다.
(Overrides NanObjSetThickUnit(Boolean, Double, Double)) | |
| ToObjectString | 객체 class 이름을 가져온다. |
| Name | Description | |
|---|---|---|
| BitmapName | 확대주기의 이미지 객체 이름을 정의 | |
| HitFlagBitmapInsideIndex | 이미지 객체 내부 hitting시 설정하기 위한 hit flag index | |
| HitFlagOffset |
hitting 된 이미지 객체와 사각 영역 객체를 구분하기 위한 XHitFlag.Index Offset XHitFlag.Index가 0~9이면 이미지 객체, 10~19이면 사각 영역 객체가 hitting 되었음을 의미 | |
| HitFlagRectangleInsideIndex | 사각 영역 내부 hitting시 설정하기 위한 hit flag index | |
| Line1Name | 확대주기의 첫번째 가이드 라인 객체 이름을 정의 | |
| Line2Name | 확대주기의 두번째 가이드 라인 객체 이름을 정의 | |
| RectangleName | 확대주기의 사각 영역 객체 이름을 정의 |
OpenFileDialog openfileDlg = new OpenFileDialog();
openfileDlg.Filter = "NVMZ|*.nvmz|벡터파일 포맷|*.nvmz";
openfileDlg.RestoreDirectory = true;
if (openfileDlg.ShowDialog() != System.Windows.Forms.DialogResult.OK) return;
string strError = string.Empty;
string strFileName = openfileDlg.FileName;
NanBase tempBase = NCanvasFileIO.LoadCanvasVector(strFileName, ref strError);
NanLayer layer = tempBase[0];
tempBase.RemoveLayer(0);
layer.CalcRange();
NEditor curCanvas = GetCurrentCanvasView();
double minx = 0;
double maxx = 0;
double miny = 0;
double maxy = 0;
if (curCanvas.Composite != null)
{
curCanvas.Composite.GetBoundRect(ref minx, ref maxx, ref miny, ref maxy);
}
else
{
minx = 0;
maxx = curCanvas.CanvasWidth;
miny = 0;
maxy = curCanvas.CanvasHeight;
}
double sfx0, sfx1, sfy0, sfy1;
sfx0 = sfx1 = sfy0 = sfy1 = 0;
Xfn.GetScaleFactor(layer.Minx, layer.Maxx, minx, maxx, ref sfx0, ref sfx1);
Xfn.GetScaleFactor(layer.Miny, layer.Maxy, miny, maxy, ref sfy0, ref sfy1);
layer.Normalize(sfx0, sfx1, sfy0, sfy1);
curCanvas.EditLayer.RemoveObjAll();
for (int i = layer.Count - 1; i >= 0; i--)
{
NanObj obj = layer[i];
layer.RemoveObj(i);
curCanvas.EditLayer.AddHead(obj);
if (obj.Type == eAnnType.Magnifier)
{
((NanMagnifier) obj).SetMagnifiedImageDelegate(curCanvas.GetMagnifiedImage);
((NanMagnifier) obj).SetMagnifiedImage(); // delegate 함수를 이용해서 확대영역 이미지를 설정한다.
}
}
curCanvas.EditLayer.CalcRange();
curCanvas.UpdateVector();
curCanvas.ZoomFit();