コード例 #1
0
 static private void UpdateSolidFillColor(Color color)
 {
     Photoshop.ActionDescriptor descriptor = new Photoshop.ActionDescriptor();
     Photoshop.ActionReference  reference  = new Photoshop.ActionReference();
     reference.PutEnumerated(PhotoshopApplication.StringIDToTypeID("contentLayer"), PhotoshopApplication.CharIDToTypeID("Ordn"), PhotoshopApplication.CharIDToTypeID("Trgt"));
     descriptor.PutReference(PhotoshopApplication.CharIDToTypeID("null"), reference);
     Photoshop.ActionDescriptor fillDescriptor  = new Photoshop.ActionDescriptor();
     Photoshop.ActionDescriptor colorDescriptor = new Photoshop.ActionDescriptor();
     colorDescriptor.PutDouble(PhotoshopApplication.CharIDToTypeID("Rd  "), color.R);
     colorDescriptor.PutDouble(PhotoshopApplication.CharIDToTypeID("Grn "), color.G);
     colorDescriptor.PutDouble(PhotoshopApplication.CharIDToTypeID("Bl  "), color.B);
     fillDescriptor.PutObject(PhotoshopApplication.CharIDToTypeID("Clr "), PhotoshopApplication.CharIDToTypeID("RGBC"), colorDescriptor);
     descriptor.PutObject(PhotoshopApplication.CharIDToTypeID("T   "), PhotoshopApplication.StringIDToTypeID("solidColorLayer"), fillDescriptor);
     PhotoshopApplication.ExecuteAction(PhotoshopApplication.CharIDToTypeID("setd"), descriptor);
 }