- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我们正在使用Paper.js构建各种图像编辑器。我们在Paper.js画布的一侧有一个队列,可以在图像之间进行切换。每次在图像之间切换时,我们都希望将所有注释平整化(光栅化)到刚编辑的图像上。
每次切换图像时,都会调用此方法,该方法会将当前图像和注释光栅化为数据URL。 (如果我们重新访问该图像,将显示该数据URL中的栅格。)
var flattenToDataUrl = function() {
layerAsRaster = paper.project.layers[0].rasterize(); // Layer to Paper.js Raster object
layerAsRaster.visible = false; // Attempt to set not visible
var dataString = layerAsRaster.toDataURL();
return dataString;
};
var setCanvasImage = function(imageObject) {
if(imageObject != null)
{
imageHeight = imageObject.height;
var imageWidth = imageObject.width;
// Set up HTMLImage
var imageElement = new Image(imageObject.width, imageObject.height);
if(_.has(imageObject, 'imageData')) { // Came as 64 bit data
imageElement.src = 'data:image/png;base64,' + imageObject.imageData;
} else if(_.has(imageObject, 'imageUrl')) { // Came as URL
imageElement.src = imageObject.imageUrl;
}
// Add image to Paper.js canvas
imageElement.onload = function(event) {
// Initialize Paper.js on the canvas
paper.setup(canvas);
raster = new paper.Raster(imageElement, new paper.Point(canvas.width / 2, canvas.height / 2));
setUpNotes();
selectedItems = new paper.Group(); // Since Paper.js has been setup we can now initialize this Group
registerCanvasEvents(); // Panning, zooming, moving selected items, deselecting all selected items
fitToPage();
};
}
};
flattenToDataUrl()
功能可使队列无缝工作。因此在我看来那里有些可疑。我们正在通过该方法生成一个Paper.js Raster对象。栅格似乎会自动添加自己。我试图通过致电来遏制
layerAsRaster.visible = false;
<canvas>
元素。这里有很多代码,还有很多清理工作,尤其是在
registerCanvasEvents()
中。忍受这个学习初学者。而且它有几百行,因此将其粘贴到您喜欢的编辑器中可能会有所帮助。入口点包括
setCanvas
(在带有
componentDidMount
元素的React类的
<canvas>
中调用)和
canvasSetImage
(从队列中调用)。我同意bmacnaughton的回答,每次加载新图像时都调用
paper.setup(canvas)
很奇怪。我目前正在研究正确的解决方案,正确的放置位置。
setCanvas
似乎合乎逻辑,但是当我拖动图像以在该设置中移动图像时,它会留下一丝图像痕迹。无论如何,这是PaperFunctions.js:
var JQueryMousewheel = require('jquery-mousewheel')($);
var SimplePanAndZoom = require('./SimplePanAndZoom.js');
var panAndZoom = new SimplePanAndZoom();
var selectedItems;
// We use selection here in two distinct ways.
// An item may be Paper.js selected but not in the selection group.
// This is because we want to show it is selectable.
// A blue bounding box indicates it is selectable.
// A green bounding box indicates it has actually been selected and added to selectedItems.
// Only things in selectedItems are actually operated on.
// So the event handlers in this method basically set up whether or not the item is in selectedItems (and therefore will be operated on for moving, resizing, deleting, etc.).
// That is, the event handlers here are concerned with displaying to the user the status of selection for the item - whether or not it will be operated on when events actually happen on the selectedItems Group.
var registerItemEvents = function(item) {
// Boolean flag for mouseup to know if was drag or click
var dragged;
// For tracking if dragging or clicking is happening
item.on('mousedown', function(e) {
dragged = false;
});
// On click toggle selection
item.on('mouseup', function(event) {
event.stopPropagation(); // Only for item applied to
event.preventDefault();
if(!dragged) {
var justAdded = addIfNotInSelectedItems(item);
if(!justAdded) { // Item was in selection group, remove it
item.remove();
paper.project.activeLayer.addChild(item);
this.selectedColor = paper.project.activeLayer.selectedColor;
//item.selected = false;
}
}
});
// Show as selectable even after has been deselected
item.on('mousemove', function(event) {
this.selected = true;
})
// If not selected, on mouse enter show that it is selectable
item.on('mouseenter', function(event) {
if(!this.selected) {
this.selected = true;
}
});
// If not selected, on mouse leave remove indicator that is selectable
item.on('mouseleave', function(event) {
var isInSelectedItems = selectedItems.getItem(item);
if(this.selected && isInSelectedItems == null) {
this.selected = false;
}
});
// On drag, move item
item.on('mousedrag', function(event) {
dragged = true;
// If user starts dragging automatically select the item
addIfNotInSelectedItems(item);
});
}
var addIfNotInSelectedItems = function(item) {
var isInSelectedItems = selectedItems.getItem(item);
if(isInSelectedItems == null) { // Item not currently in selection group, add it
selectedItems.addChild(item);
item.selectedColor = 'green';
item.selected = true;
return true; // Was added, return true
} else {
return false; // Already in, return false
}
}
var registerCanvasEvents = function() {
if(paper.view != null && canvas != null) {
// Zoom on mousewheel
$(canvas).mousewheel(function(event) {
event.preventDefault();
var mousePosition = new paper.Point(event.offsetX, event.offsetY);
var viewPosition = paper.view.viewToProject(mousePosition);
var returnedValues = panAndZoom.changeZoom(paper.view.zoom, (event.deltaY * -1), paper.view.center, viewPosition, 1.1);
var newZoom = returnedValues[0];
var offset = returnedValues[1];
paper.view.zoom = newZoom;
paper.view.center = paper.view.center.add(offset);
});
// For tracking if dragging or clicking is happening
var dragged;
paper.project.layers[0].on('mousedown', function(e) { // TODO should be layer 0 in long run?
dragged = false;
});
// Pan on mouse drag
/*paper.project.layers[0].on('mousedrag', function(event) { // TODO should be layer 0 in long run?
if(!event.event.ctrlKey && !event.event.altKey && !event.event.shiftKey) { // No keys (that we use) can be pushed
dragged = true; // We're panning, we don't wish to deselect all items as we would do with a click
paper.view.center = panAndZoom.changeCenter(paper.view.center, event.delta.x, event.delta.y, 0.7);
//event.preventDefault();
}
});*/
// Move selected items on mouse drag
selectedItems.on('mousedrag', function(event) {
event.stopPropagation(); // Don't propogate up or it will register as a pan event
event.preventDefault();
dragged = true; // We're panning, we don't wish to deselect all items as we would do with a click
this.translate(new paper.Point(event.delta.x, event.delta.y));
});
// If was a click and not a drag, deselect selected items
paper.project.layers[0].on('mouseup', function(event) {
if(!dragged) {
var removedItems = selectedItems.removeChildren(); // Remove from selection group, which also removes from display
paper.project.activeLayer.addChildren(removedItems); // Return to display
// Reset selection colors for showing selectable
for(var i =0; i < removedItems.length; i++) {
removedItems[i].selectedColor = paper.project.activeLayer.selectedColor;
removedItems[i].selected = false;
}
}
});
// Initial path object, will be reset for new paths after Alt is released
var path = newPath();
var paths = [];
paths.push(path);
// On mousedown add point to start from
paper.project.layers[0].on('mousedown', function(event) {
if(event.event.altKey && !event.event.ctrlKey) { // Alt key to add a path, but disallow attempting to add text at the same time
if(paths[paths.length-1].lastSegment == null) {
//path.add(event.point, event.point);
paths[paths.length-1].add(event.point, event.point);
} else {
//path.add(path.lastSegment.point, path.lastSegment.point);
paths[paths.length-1].add(paths[paths.length-1].lastSegment.point, paths[paths.length-1].lastSegment.point);
}
}
});
// On mousedrag add points to path
paper.project.layers[0].on('mousedrag', function(event) {
if(event.event.altKey && !event.event.ctrlKey) { // Alt key to add a path, but disallow attempting to add text at the same time
if(event.event.shiftKey) { // Use shift key for freeform
//path.add(event.point);
paths[paths.length-1].add(event.point);
} else { // Default of straight line added to path
//path.lastSegment.point = event.point;
paths[paths.length-1].lastSegment.point = event.point;
}
}
}.bind(this));
var tool = new paper.Tool();
var startDragPoint;
// Capture start of drag selection
paper.tool.onMouseDown = function(event) {
if((event.event.ctrlKey && event.event.shiftKey) || (event.event.ctrlKey && event.event.altKey)) {
startDragPoint = new paper.Point(event.point);
}
};
paper.tool.onMouseDrag = function(event) {
// Panning
if(!event.event.ctrlKey && !event.event.altKey && !event.event.shiftKey) { // No keys (that we use) can be pushed
dragged = true; // We're panning, we don't wish to deselect all items as we would do with a click
paper.view.center = panAndZoom.changeCenter(paper.view.center, event.delta.x, event.delta.y, 0.7);
//event.preventDefault();
}
// Show box indicating the area that has been selected
// For moving area and whiting out area
if((event.event.ctrlKey && event.event.shiftKey) || (event.event.ctrlKey && event.event.altKey)) {
dragged = true;
var showSelection = new paper.Path.Rectangle({
from: startDragPoint,
to: event.point,
strokeColor: 'red',
strokeWidth: 1
});
// Stop showing the selected area on drag (new one is created) and up because we're done
showSelection.removeOn({
drag: true,
up: true
});
}
};
// Capture start of drag selection
paper.tool.onMouseUp = function(event) {
if((event.event.ctrlKey && event.event.shiftKey) || (event.event.ctrlKey && event.event.altKey)) {
var endDragPoint = new paper.Point(event.point);
if(event.event.ctrlKey && event.event.shiftKey) { // Whiteout area
whiteoutArea(startDragPoint, endDragPoint);
} else if(event.event.ctrlKey && event.event.altKey) { // Move selected area
selectArea(startDragPoint, endDragPoint);
}
}
};
// Key events
paper.tool.onKeyUp = function(event) {
// Delete selected items on delete key
if(event.key == 'delete') {
selectedItems.removeChildren();
} else if (event.key == 'option') {
registerItemEvents(paths[paths.length-1]);
// Start a new path
paths.push(newPath());
}
}
}
}
// These variables are scoped so that all methods in PaperFunctions can access them
var canvas; // Set by setCanvas
var imageHeight; // Set by setCanvasImage
var raster;
var toolsSetup = false;
var setCanvas = function(canvasElement) {
canvas = canvasElement;
paper.setup(canvas);
};
var setCanvasImage = function(imageObject) {
if(imageObject != null)
{
imageHeight = imageObject.height;
var imageWidth = imageObject.width;
// Set up HTMLImage
var imageElement = new Image(imageObject.width, imageObject.height);
if(_.has(imageObject, 'imageData')) { // Came as 64 bit data
imageElement.src = 'data:image/png;base64,' + imageObject.imageData;
} else if(_.has(imageObject, 'imageUrl')) { // Came as URL
imageElement.src = imageObject.imageUrl;
}
// Add image to Paper.js canvas
imageElement.onload = function(event) {
//canvas.height = $(document).height()-3; // Set canvas height. Why do this here and not in the React component? Because we set the width here too, so we're keeping those together. Perhaps in the future this will be changed when we are responsive to window resizing.
//scalingFactor = canvas.height / imageObject.height; // Determine the ratio
//canvas.width = imageElement.width * scalingFactor; // Scale width based on height; canvas height has been set to the height of the document
// Initialize Paper.js on the canvas
paper.setup(canvas);
raster = new paper.Raster(imageElement, new paper.Point(canvas.width / 2, canvas.height / 2));
//setUpLineAndFreeFormDrawing(); // TODO once we cycle through images will we need to reset this for each new image or can we do this just once?
setUpNotes(); // TODO once we cycle through images will we need to reset this for each new image or can we do this just once?
selectedItems = new paper.Group(); // Since Paper.js has been setup we can now initialize this Group
registerCanvasEvents(); // Panning, zooming, moving selected items, deselecting all selected items
fitToPage();
};
}
};
var fitToPage = function() {
if(paper.view != null && canvas != null) {
// Fit image to page so whole thing is displayed
var scalingFactor = canvas.height / imageHeight; // Constant representation of the ratio of the canvas size to the image size
var zoomFactor = scalingFactor / paper.view.zoom; // Dynamic representation of the zoom needed to return to viewing the whole image in the canvas
// Reset the center point to the center of the canvas
var canvasCenter = new paper.Point(canvas.width/2, canvas.height/2);
paper.view.center = canvasCenter;
// Zoom to fit the whole image in the canvas
var returnedValues = panAndZoom.changeZoom(paper.view.zoom, -1, canvasCenter, canvasCenter, zoomFactor); // Always pass -1 as the delta, not entirely sure why
var newZoom = returnedValues[0];
var offset = returnedValues[1];
paper.view.zoom = newZoom;
paper.view.center = paper.view.center.add(offset);
}
};
var addImage = function(imageDataUrl) {
if(paper.view != null) {
var img = document.createElement("img");
img.src = imageDataUrl;
var presentMomentForId = new Date().getTime() + "-image"; // For purposes of having unique IDs
img.id = presentMomentForId;
img.hidden = true;
document.body.appendChild(img);
var raster = new paper.Raster(presentMomentForId);
registerItemEvents(raster);
}
};
var setUpLineAndFreeFormDrawing = function() {
if(paper.project != null) {
// Initial path object, will be reset for new paths after Alt is released
var path = newPath();
var paths = [];
paths.push(path);
// On mousedown add point to start from
paper.project.layers[0].on('mousedown', function(event) {
if(event.event.altKey && !event.event.ctrlKey) { // Alt key to add a path, but disallow attempting to add text at the same time
if(paths[paths.length-1].lastSegment == null) {
//path.add(event.point, event.point);
paths[paths.length-1].add(event.point, event.point);
} else {
//path.add(path.lastSegment.point, path.lastSegment.point);
paths[paths.length-1].add(paths[paths.length-1].lastSegment.point, paths[paths.length-1].lastSegment.point);
}
}
});
// On mousedrag add points to path
paper.project.layers[0].on('mousedrag', function(event) {
if(event.event.altKey && !event.event.ctrlKey) { // Alt key to add a path, but disallow attempting to add text at the same time
if(event.event.shiftKey) { // Use shift key for freeform
//path.add(event.point);
paths[paths.length-1].add(event.point);
} else { // Default of straight line added to path
//path.lastSegment.point = event.point;
paths[paths.length-1].lastSegment.point = event.point;
}
}
}.bind(this));
// Each time Alt comes up, start a new path
paper.tool.onKeyUp = function(event) {
if(event.key == "option") {
registerItemEvents(paths[paths.length-1]);
// Start a new path
paths.push(newPath());
}
};
}
};
// Establishes default line style
var newPath = function() {
var path = new paper.Path();
path.strokeColor = 'black';
path.strokeWidth = 10;
return path;
};
var note = "";
var setNote = function(newNote) {
note = newNote;
};
var setUpNotes = function() {
if(paper.project != null) {
paper.project.layers[0].on('mousedown', function(event) { // TODO should be layer 0 in long run?
if(event.event.ctrlKey && !event.event.altKey && !event.event.shiftKey) { // Only Ctrl key to add text
// Add text box
var textBox = new paper.PointText(event.point);
textBox.justification = 'left';
textBox.fillColor = 'black';
textBox.fontSize = 60;
textBox.content = note;
registerItemEvents(textBox);
}
});
}
};
var selectArea = function(startDragPoint, endDragPoint) {
var rasterTopLeftCorner = new paper.Point(raster.bounds.topLeft);
var adjustedStartDragPoint = new paper.Point(startDragPoint.x - rasterTopLeftCorner.x, startDragPoint.y - rasterTopLeftCorner.y);
var adjustedEndDragPoint = new paper.Point(endDragPoint.x - rasterTopLeftCorner.x, endDragPoint.y - rasterTopLeftCorner.y);
var boundingRectangleRasterCoordinates = new paper.Rectangle(adjustedStartDragPoint, adjustedEndDragPoint);
var boundingRectangleCanvasCoordinates = new paper.Rectangle(startDragPoint, endDragPoint);
var selectedArea = raster.getSubRaster(boundingRectangleRasterCoordinates);
var whitedOutSelection = new paper.Shape.Rectangle(boundingRectangleCanvasCoordinates);
whitedOutSelection.fillColor = 'white';
whitedOutSelection.insertAbove(raster); // Whiteout just above the image we're working with
registerItemEvents(selectedArea);
}
var whiteoutArea = function(startDragPoint, endDragPoint) {
var whitedOutSelection = new paper.Shape.Rectangle(startDragPoint, endDragPoint);
whitedOutSelection.fillColor = 'white';
whitedOutSelection.insertAbove(raster); // Whiteout just above the image we're working with
}
var flattenToDataUrl = function() {
layerAsRaster = paper.project.layers[0].rasterize(); // TODO should be layer 0 in long run? // Layer to Paper.js Raster object
layerAsRaster.visible = false;
var dataString = layerAsRaster.toDataURL();
return dataString;
};
module.exports = {
setCanvas: setCanvas,
setCanvasImage: setCanvasImage,
fitToPage: fitToPage,
addImage: addImage,
setNote: setNote,
flattenToDataUrl: flattenToDataUrl
};
// Based on http://matthiasberth.com/articles/stable-zoom-and-pan-in-paperjs/
var SimplePanAndZoom = (function() {
function SimplePanAndZoom() { }
SimplePanAndZoom.prototype.changeZoom = function(oldZoom, delta, centerPoint, offsetPoint, zoomFactor) {
var newZoom = oldZoom;
if (delta < 0) {
newZoom = oldZoom * zoomFactor;
}
if (delta > 0) {
newZoom = oldZoom / zoomFactor;
}
// Zoom towards offsetPoint, not centerPoint (unless they're the same)
var a = null;
if(!centerPoint.equals(offsetPoint)) {
var scalingFactor = oldZoom / newZoom;
var difference = offsetPoint.subtract(centerPoint);
a = offsetPoint.subtract(difference.multiply(scalingFactor)).subtract(centerPoint);
}
return [newZoom, a];
};
SimplePanAndZoom.prototype.changeCenter = function(oldCenter, deltaX, deltaY, factor) {
var offset;
offset = new paper.Point(-deltaX, -deltaY);
offset = offset.multiply(factor);
return oldCenter.add(offset);
};
return SimplePanAndZoom;
})();
module.exports = SimplePanAndZoom;
最佳答案
我在这里进行一些猜测,但是我将解决代码中的一些问题,这些问题有望解决您所看到的行为。
首先,我假设paper.project.layers[0]
是paper.project.activeLayer
。一旦将其栅格化1)将栅格添加到图层,并且设置visible = false
确实会导致它在更新完成后消失。
其次,当您在paper.setup(canvas)
中调用imageElement.onload
时,将创建一个新的纸张项目。该项目从活动项目开始,使先前的项目“消失”。因此,当您使用raster = new paper.Raster(...)
创建栅格时,它将进入新项目,而不是旧项目。
因此,现在在旧项目中有一个隐藏(.visible = false
)栅格(我们将其称为project1),在project2中有一个新版本。
我不确定这是否是预期的行为,但是当您第二次调用paper.setup(canvas)
时,纸张似乎注意到它们都引用相同的画布并且使project1和project2保持同步。因此,创建第二个项目将清除第一个项目的子数组。添加new paper.Raster(...)
最终将栅格添加到project1和project2。
现在我无法说出下一个难题是什么。您需要添加一些信息,例如1)设置鼠标事件处理程序的位置以及它们的附加内容; 2)setUpNotes()的作用; 3)registerCanvasEvents()的作用; 4)fitToPage的作用。
创建了一些全局变量,imageHeight
和raster
可能不是故意的。目前尚不清楚为什么需要使用new Image()
-paper.Raster()
接受URL,包括数据URL。
我很惊讶纸清除了第一个项目。很好奇
版本2:
让我刺破使用层来构造它。我建议您摆脱多个项目,因为将鼠标事件处理程序附加到共享同一画布的多个项目会增加太多的复杂性。
因此,在代码初始化中:paper.setup(canvas)
。只能这样做一次。
在最初由纸张创建的单层中设置初始图像。
// this will be inserted into the current layer, project.activeLayer
var raster = new paper.Raster(imageURL, paper.view.bounds.center);
// make the existing image/layer invisible
paper.project.activeLayer.visible = false;
// add a new layer which is inserted in the project and activated
var layer = new paper.Layer();
// the new layer is activated, create a raster for the image
var raster = new paper.Raster(imageURL, paper.view.bounds.center);
// now do your normal logic for editing, zooming, etc.
var imageURLs = ["url to image1", "url to image2", "etc"];
imageURLs.forEach(function(url) {
new paper.Layer();
paper.project.activeLayer.visible = false;
new paper.Raster(url, paper.view.bounds.center);
});
// make the first layer visible and activate it
paper.project.layers[0].visible = true;
paper.project.layers[0].activate();
function setImage(index) {
paper.project.activeLayer.visible = false;
paper.project.layers[index].activate();
paper.project.layers[index].visible = true;
}
activeLayer
的另一组处理程序分别用于“ mousedown”,“ mousedrag”和“ mouseup”事件,并且
selectedItems
也具有“ mousedrag”的处理程序。我无法跟踪所有不同的处理程序在项目中应该做什么。我猜这是您所看到的闪烁的根本原因。
paper.view.on
用于'mousedown','mousedrag'和'mouseup'事件。当我得到一个事件时,我将使用以下命令检查该图层上是否有任何东西被击中:
paper.project.activeLayer.hitTest(event.point);
unSelectedGroup.on('mouseenter', function() {
unSelectedGroup.selected = true;
});
unSelectedGroup.on('mouseleave', function() {
unSelectedGroup.selected = false;
});
paper.view.on('mousemove', ...)
并使用
hitTest
自己处理'mouseenter'和'mouseleave'事件,如上所示,但是任何一种方法都应该起作用。
关于javascript - Paper.js背景栅格化故障,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33682575/
我正在使用 CSS background: url(stuffhere.jpeg)对于我的背景,但是当你点击其他视频时,“元素”不是页面,背景不会改变。 我试过了 和 ,并尝试为#home 和#pr
这两个 CSS 属性有区别吗: background: none; background: transparent; 它们都有效吗? 应该使用哪一个,为什么? 最佳答案 它们之间没有区别。 如果您没有
csslint 警告回退背景(十六进制或 RGB)应该在 RGBA 背景之前。"evidence="background: rgba(0, 0, 0, 0.8);/* FF3+,Saf3+,Opera
我在我正在制作的新网站上使用 Flip 插件: http://www.concept-it.be/padre (点击联系人,然后点击电子邮件地址)。 正如你所看到的,当翻转开始后,div 的背景变成灰
有没有办法使用“前后”图像作为全尺寸背景?我想会很棒!我正在尝试将此类示例用作整页大小的图像; http://www.catchmyfame.com/2009/06/25/jquery-beforea
我认为答案是否定的,但是... 有没有办法说: background-size: contain 90% 所以它的作用正是 contain 会做的,但是然后将它调整得更小一些? 最佳答案 理想的解决方
将鼠标悬停在给定文本的每个字母上将更改文本的整个字体 + 正文背景颜色。我试过了,但我的尝试失败了。相反,字体只在被悬停的字母之后发生变化,我什至不知道如何从 div 选择器中影响正文背景颜色。 .h
我想给我的 UITableView 提供背景图片,所以我尝试了这个方法: - (void)viewDidLoad { [super viewDidLoad]; // Do any additional
我正在尝试使用 Python 3.6 使用 PIL/Numpy(每个屏幕截图~0.01s)快速截取准备处理的屏幕截图。理想情况下,窗口不需要位于前台,即即使另一个窗口覆盖它,屏幕截图仍然成功。 到目前
我正在尝试做一些可能不可能的事情,但让我们看看你怎么想。这是我的代码: html { background: url(../img/pattern.png) repeat, url(../im
一位设计师想出了这种类型的背景,如下图所示。我想避免使用图像背景。因此,如果可以使用 CSS background 属性复制它,我会努力思考。 最底层只是一个线性渐变,没有问题。但是在其之上分层的圆形
当 TreeView(或应用程序)失去焦点时,如何更改所选 TreeViewItem 的背景。在这种情况下,默认情况下选定的项目具有浅灰色背景。 编辑:第一个答案后的尝试:但是找不到带有 Target
一位设计师想出了这种类型的背景,如下图所示。我想避免使用图像背景。因此,如果可以使用 CSS background 属性复制它,我会努力思考。 最底层只是一个线性渐变,没有问题。但是在其之上分层的圆形
我需要有一个带有 CSS 的背景作为附加的图像我不能让它与线性渐变一起工作。 我正在尝试以下操作,但我无法仅创建 1 个白色条纹。 div { background: #5cbcb0; bac
我有一个ListView,它有一个页眉和页脚。它们在 CardView 中的布局。以及其中必须为背景的内容列表。这是一张可以清楚看到的图片:我现在是这样的: 以及如何做: 我这样做了,ScrollVi
我目前有一个 DIV,其背景图像设置如下: background: url(../images/site/common/body-bannar-bkground.png) repeat 0 0; 如何
我有一个 slider ,需要在不使用 .style.backgroundImage 的情况下更改背景。那么我该如何通过向 slider 或其他东西添加一些类来做到这一点呢? 'use strict'
好的,所以在 photoshop 中,我创建了一个具有透明背景和一些文本的 8 位彩色图像。然后我创建了一个具有透明背景和一些文本的 16 位颜色的图像。 当我右键单击两个图像并转到属性时,它显示两个
我有一个问题困扰着我,我似乎在 Google 上找不到答案。我用一段代码创建了一个小型测试应用程序,它执行如下操作: 在 MainActivity 中,我创建了一个 SomeClass 的实例,它有一
我想做这个, 在 Android Studio 的预览中看起来不错,但在运行时我得到这个 正如您在屏幕开头看到的那样,颜色是白色,我想添加我自己的颜色,在本例中为绿色。 最初它使用的是 Cordina
我是一名优秀的程序员,十分优秀!