Photoshop Plugin Development constituency (Selection)

Source: Internet
Author: User

The graphs we use in our program are all in a big picture, so there's a file where each small image is placed somewhere in the big picture, like this:

<name="button" left="10" top="30" right="24" bottom="70"/>.If the picture is less than good, more than dozens of, hundreds of such records, every time to update a map to find half a day, especially when the interface changes, almost all the small map position has changed, so you will find in Photoshop every small map, note its coordinates, and then write to the configuration file. If occasionally do also endure, but this unfortunate thing often happen, unbearable, think this kind of thing computer should be competent, it capable of things, we resolutely cannot do for it. Carefully studied for a few days, finally studied the PS plug-in mechanism, you can achieve the first CTRL + C some coordinate positions, and then select these areas in PS.

or adobe compared to cattle, we worked hard to help it develop plug-ins, it also charges. Now the PS plugin developed by the SDK has not been free to download, but also in the free internet can also find an earlier version of the Free SDK, I found is 6.0, the development of plug-ins can be used in the latest PS CS2.

According to the official document statement, PS probably support 9 kinds of plug-ins, more common is the filter, commonly used to implement some special image processing algorithms, such as edge extraction, I am interested in the Select plug-in, see the name is like and constituency. The use of Plug-ins is very simple, placed in the PS installation directory under the Plug-ins directory under the corresponding categories can be, such as the filter is placed under plug-ins\filters, extension is. 8BF, select the plugin placed under Plug-ins\select, This directory is searched when the extension. 8bs.ps is started.

PS SDK with a lot of examples of plug-ins, you can find your interest in the category of plug-in examples to see, and then change on it. Let's take a look at the Selectorama example in the selection directory of the PS 6.0 SDK. It demonstrates how to select an area of interest on the current document, but the example seems a little more complicated.

PS Windows Plug-ins are generally a standard DLL, the entry function is Pluginmain, the prototype is: void PluginMain (const short selector,PISelectionParams *selectionParamBlock,long *data,short *result); where, selector is a type parameter, indicating what the purpose of this call, if the constant " Selectionselectorabout ", indicating that a dialog box needs to be displayed. In the filter plug-in, Pluginmain is invoked multiple times, depending on the selector to determine what action to take.

Selectionparamblock is a pointer to a huge structure with almost everything you need. For example, the size of the current document can be passed

selectionParamBlock->documentInfo->bounds

Get, if you want to know if the user has now selected an area, can be obtained by selectionparamblock-&gt;documentinfo-&gt;selection-&gt;bounds.

The remaining two are output parameters, which can be used to store handles, return errors, and so on, for the time being.

In the Pluginmain function, will indirectly call the Doexecute function, passed the parameter called Globals, in fact, is the input parameters Selectionparamblock packaging a bit, really useful or

globals->selectionParamBlock

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.