يوضح المثال التالي دعم تحميل موارد VmskResource. كيف يعمل تحرير المسارات.
[C#][Test]publicvoidTestPsdNet106(){stringsourceFileName="Rectangle.psd";stringexportPath="Rectangle_changed.psd";varim=(PsdImage)Image.Load(sourceFileName);using(im){varresource=GetVmskResource(im);// قراءةif(resource.IsDisabled!=false||resource.IsInverted!=false||resource.IsNotLinked!=false||resource.Paths.Length!=7||resource.Paths[0].Type!=VectorPathType.PathFillRuleRecord||resource.Paths[1].Type!=VectorPathType.InitialFillRuleRecord||resource.Paths[2].Type!=VectorPathType.ClosedSubpathLengthRecord||resource.Paths[3].Type!=VectorPathType.ClosedSubpathBezierKnotUnlinked||resource.Paths[4].Type!=VectorPathType.ClosedSubpathBezierKnotUnlinked||resource.Paths[5].Type!=VectorPathType.ClosedSubpathBezierKnotUnlinked||resource.Paths[6].Type!=VectorPathType.ClosedSubpathBezierKnotUnlinked){thrownewException("VmskResource was read wrong");}varpathFillRule=(PathFillRuleRecord)resource.Paths[0];varinitialFillRule=(InitialFillRuleRecord)resource.Paths[1];varsubpathLength=(LengthRecord)resource.Paths[2];// لا تحتوي قاعدة تعبئة المسار على أي معلومات إضافيةif(pathFillRule.Type!=VectorPathType.PathFillRuleRecord||initialFillRule.Type!=VectorPathType.InitialFillRuleRecord||initialFillRule.IsFillStartsWithAllPixels!=false||subpathLength.Type!=VectorPathType.ClosedSubpathLengthRecord||subpathLength.IsClosed!=true||subpathLength.IsOpen!=false){thrownewException("VmskResource paths were read wrong");}// التحريرresource.IsDisabled=true;resource.IsInverted=true;resource.IsNotLinked=true;varbezierKnot=(BezierKnotRecord)resource.Paths[3];bezierKnot.Points[0]=newPoint(0,0);bezierKnot=(BezierKnotRecord)resource.Paths[4];bezierKnot.Points[0]=newPoint(8039797,10905190);initialFillRule.IsFillStartsWithAllPixels=true;subpathLength.IsClosed=false;im.Save(exportPath);}}privateVmskResourceGetVmskResource(PsdImageimage){varlayer=image.Layers[1];VmskResourceresource=null;varresources=layer.Resources;for(inti=0;i<resources.Length;i++){if(resources[i]isVmskResource){resource=(VmskResource)resources[i];break;}}if(resource==null){thrownewException("VmskResource not found");}returnresource;}