如何使用Gulp将public static java.awt.Image getImageFromPanel(Component component) {
Point p = new Point(0, 0);
SwingUtilities.convertPointToScreen(p, component);
int width = component.getSize().width;
int height = component.getSize().height;
Rectangle screenBounds = new Rectangle(p.x, p.y, width, height);
Robot robot = new Robot();
BufferedImage image = robot.createScreenCapture(screenBounds);
component.getGraphics().drawImage(image, 0, 0, component);
return image;
}
文件从sass
文件夹编译并移动到sass/**
目录?
css/**
PS:每个src('sass/**/*.sass')
dest('css/**/*.css')
文件必须将其编译为sass
- 版本(没有文件连接)
PPS:我无法使用css
方法,因为我还必须查看其他文件(sass --w sass:css
,.js
)以进行更改
答案 0 :(得分:-1)
在你的gulpfile.js
中var gulp = require('gulp');
var sass = require('gulp-sass');
// styles task : for generating css
gulp.task('styles', function() {
return gulp.src('sass/**/*.scss')
.pipe(sass())
.pipe(gulp.dest('css/'))
});
// watch task : which will watch for changes, and run styles task
gulp.task('watch', function() {
gulp.watch('sass/**/*.scss', ['styles']);
});
然后在终端中运行以下
gulp watch