开发者

Generate, crop and save images

开发者 https://www.devze.com 2023-02-20 17:24 出处:网络
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.

I am looking to automate a process of:

  1. Taking text fr开发者_C百科om a csv and using the value as text for a css button.
  2. Capturing that HTML and cropping it so the whitespace is not included
  3. 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

0

精彩评论

暂无评论...
验证码 换一张
取 消