Generate, crop and save images
I am looking to automate a process of:
- Taking text fr开发者_C百科om a csv and using the value as text for a css button.
- Capturing that HTML and cropping it so the whitespace is not included
- Saving the captured button
Steps 1 and 3 are trivial but the problem comes in at step 2. Does anyone know how to take a "screenshot" that targets a specific area of the screen not using co-ordinates or width and height? The images will be variable in width.
I was thinking perhaps it could be based on colour? If a certain colour is encountered at both X and Y then we have an area.
I'm guess your trying to get images out of this so the best thing I can think of is to use GD or imgmagik to generate them and forget the css or maybe you have a mac an photoshop and can write an applescript to automate the process
精彩评论