我跑步后ionic cordova build android得到这个错误:
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all files for configuration ':debugCompileClasspath'.
> Could not find runtime.jar (android.arch.lifecycle:runtime:1.0.0).
Searched in the following locations:
https://jcenter.bintray.com/android/arch/lifecycle/runtime/1.0.0/runtime-1.0.0.jar
Run Code Online (Sandbox Code Playgroud)
这是对的.当我转到此URL时,https://jcenter.bintray.com/android/arch/lifecycle/runtime/1.0.0/runtime-1.0.0.jar我得到404 Not found error一个JSON.
我没有在该URL中看到任何特定于android/cordova的版本,因此我无法从我的cordova安装中说出它.
科尔多瓦版: 7.1.0
离子信息:
cli packages: (C:\Users\%User%\AppData\Roaming\npm\node_modules)
@ionic/cli-utils : 1.19.2
ionic (Ionic CLI) : 3.20.0
global packages:
cordova (Cordova CLI) : not installed // this is strange. I can run cordova in my terminal tho
local …Run Code Online (Sandbox Code Playgroud) 我正在使用glfx.js来编辑我的图像但是当我试图使用该toDataURL()函数获取该图像的数据时,我得到一个空白图像(宽度与原始图像的大小相同).
奇怪的是,在Chrome中脚本运行完美.
我想提到的是canvas使用onload事件加载图像:
img.onload = function(){
try {
canvas = fx.canvas();
} catch (e) {
alert(e);
return;
}
// convert the image to a texture
texture = canvas.texture(img);
// draw and update canvas
canvas.draw(texture).update();
// replace the image with the canvas
img.parentNode.insertBefore(canvas, img);
img.parentNode.removeChild(img);
}
Run Code Online (Sandbox Code Playgroud)
我的图像的路径也在同一个域上;
问题(在Firefox中)是我点击保存按钮.Chrome会返回预期的结果,但Firefox会返回此信息:
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA7YAAAIWCAYAAABjkRHCAAAHxklEQVR4nO3BMQEAAADCoPVPbQZ/oAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
... [ lots of A s ] ...
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAzwD6aAABkwvPRgAAAABJRU5ErkJggg==
Run Code Online (Sandbox Code Playgroud)
什么可能导致这个结果,我该如何解决?
我想使用像素位置绘制一个圆圈(带有1或2个循环)(从左上角开始到右下角结束)
我用这个方法成功绘制了一个矩形:
private void drawrect(int width,int height,int x,int y) {
int top=y;
int left=x;
if(top<0){
height+=top;
top=0;
}
if(left<0){
width+=left;
left=0;
}
for (int j = 0; j <width; j++) {
for (int i = 0; i <height; i++) {
pixels[((i+top)*w)+j+left] = 0xffffff;//white color
}
}
}
Run Code Online (Sandbox Code Playgroud)
像素数组包含像素索引,后跟颜色.
pixels[index]=color;
Run Code Online (Sandbox Code Playgroud)
在此之前,我将此代码用于"图像"和"像素"数组(如果这对您有帮助)
img = new BufferedImage(WIDTH, HEIGHT, BufferedImage.TYPE_INT_RGB);
pixels = ((DataBufferInt) img.getRaster().getDataBuffer()).getData();
Run Code Online (Sandbox Code Playgroud)
但是,如何只绘制此图像中的白色像素并忽略其他像素?
我在这里有这个网站
正如您所看到的,"图像"和"Web模板"选项卡上有一个微小的图像滑块,图像从右向左滑动,然后消失,然后它出现在父元素的最后(<tr>在我的情况下) .
如果将鼠标悬停在小图像上,则可以在左侧看到它的预览.
到现在为止还挺好.
但是,如果您等到第一张图像再次出现,则悬停事件将不再起作用.
有可能jquery无法在<tr>标记的末尾看到新的附加元素吗?
我有一个非常小的应用程序:
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<a href="mailto:someone@example.com">Send Mail</a>
<a href="tel: +18543458975">Call</a>
<button onclick="document.location.href = 'tel:+1-800-555-1234'">Click me</button>
<button onclick="document.location.href = 'tel:+18543458975'">Click again</button>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
当我构建并运行它时,链接根本不起作用.
两个星期前(在另一个应用程序上)这个工作完美但现在它不适用于我的旧应用程序.
我的想法用完了!
发生了什么事?
我正在使用 WEBGL,今天遇到了我的立方体顶点法线的问题。
我用互联网上的立方体网格检查了我的代码,效果很好。
问题是,来自互联网的立方体有 24 个顶点(每个面 4 个顶点 * 6 个面),我认为这对于我的立方体来说太多了。
摆弄我的立方体| FIDDLE INTERNET CUBE(我的代码在第 200 行)
我发现一个立方体需要不超过 8 个顶点和 12 个索引。但是当我渲染立方体时,我在屏幕上看到一个奇怪的形状,如下所示(因为法线?):

这是互联网的立方体,其旋转位置与我的立方体几乎相同:

这是我的立方体:
var cube = {
"vertices" : [
-0.5 , 0.5 , 0.5, // 0
0.5 , 0.5 , 0.5, // 1
-0.5 ,-0.5 , 0.5, // 2
0.5 ,-0.5 , 0.5, // 3
-0.5 , 0.5 , -0.5, // 4
0.5 , 0.5 , -0.5, // 5
-0.5 ,-0.5 , -0.5, // 6 …Run Code Online (Sandbox Code Playgroud) 我试图创建一个使用CSS3的Flexbox的功能,简单的布局,但我遇到了一个问题:我不能把我的影子nav元素在main即使元素nav元素之后main.
我尝试使用该order属性,但我无法弄清楚为什么这个nav阴影在main
html {
height: 100%;
}
body {
display: flex;
flex-direction: column;
height: 100%;
margin: 0;
}
body >* {
background-color: #333;
color: #bdbdbd;
box-shadow: 0px 0px 10px 2px #000;
text-shadow: 0 -1px 0 #000;
padding: 10px;
}
main {
height: 500px;
order: 1;
}
nav {
order: 0;
}
footer {
order: 2;
}Run Code Online (Sandbox Code Playgroud)
<main>Main content</main>
<nav>Navigation</nav>
<footer>Footer</footer>Run Code Online (Sandbox Code Playgroud)
可以在不使用poasition:abosolute属性的情况下执行此操作(仅限Flexbox功能)?
我正在使用安装 Jekyll 的 Windows 10 的 Linux 子系统,但是当我运行bundle exec jekyll serve它时,它给了我:
jekyll 3.8.6 | Error: Operation not permitted @ apply2files - /mnt/e/Work/project/_site/images/banner.jpg
我知道 Windows 和 Linux 权限存在一些不兼容问题,因为出于某种原因,我的所有文件都归 root 所有,但是有解决此问题的方法吗?
我在这里找到了答案https://scottdorman.blog/2019/02/27/running-jekyll-on-wsl/作者说我必须关闭并重新打开 bash,但它不起作用。
是否可以以倒计时样式格式化秒?例如,如果我有var seconds = 3662,我该如何显示:1 hour 1 minute 2 seconds。
我尝试使用,formatDistanceStrict(3662)但这只是打印小时:1 hour。
是否有内置方法来显示分钟和秒?我不想写 100 行代码来让它工作(就像互联网上的其他例子一样)
我这里有这个代码用于创建像素数组并将其绘制到图像中:
import javax.swing.JFrame;
import java.awt.Canvas;
import java.awt.Graphics;
import java.awt.image.BufferStrategy;
import java.awt.image.BufferedImage;
import java.awt.image.DataBufferInt;
public class test extends Canvas implements Runnable {
private static final long serialVersionUID = 1L;
public static int WIDTH = 800;
public static int HEIGHT = 600;
public boolean running = true;
public int[] pixels;
public BufferedImage img;
public static JFrame frame;
private Thread thread;
public static void main(String[] arg) {
test wind = new test();
frame = new JFrame("WINDOW");
frame.add(wind);
frame.setVisible(true);
frame.setSize(WIDTH, HEIGHT);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
wind.init();
} …Run Code Online (Sandbox Code Playgroud) 我正在尝试event based editor在星际争霸2编辑器中创建一个类似的算法,可以支持:
与星际争霸2编辑器完全相同(当然也不是3D的东西)
到目前为止,我正在考虑使用JSON,在对象中添加每个事件,然后循环遍历它们并使用该addEventListener()方法创建事件.
JSON事件对象(当然它将由用户在编辑器中创建,无需编程):
var Events={
//your event's names here
onReady:{ //on page ready to manipulate
displayMessage:{//just a simple popup
text:"Hello user!",
title:"Welcome!",
type:"normal",
},
createButton:{ //creates a buton on the screen
text:"Click me!",
id:"myButton"
}
},
onClick:{
id:"myButton" ,//the id of the button we just created
actions:{ //the actions applied after we click the button
displayMessage:{//just a simple popup
text:"You pressed me!",
title:"Button",
type:"error",//show the …Run Code Online (Sandbox Code Playgroud) 我有一个缓冲的图像与我的框架的大小:
public BufferedImage img;
public static int WIDTH = 800;
public static int HEIGHT = 600;
img=new BufferedImage(WIDTH, HEIGHT,BufferedImage.TYPE_INT_RGB);
Run Code Online (Sandbox Code Playgroud)
我怎么画它所以我只能看到填充框架的黑色图像?不使用Canvas
我想在不使用paint或paintComponent函数的情况下仅使用图形中的drawImage函数
如果可能,我如何为该图像分配1D阵列[WIDTH*HEIGHT]?
简单:我想创建一个图像,将数组中的值转换为像素(0 =黑色,999999999 =浅蓝色等)并将其绘制到屏幕上.
编辑:
这是不能按预期工作的代码(它应该是一个带有黑色绘制图像的框架),但它只是一个空白框架.为什么图像没有添加到框架中?

import javax.swing.*;
import java.awt.Canvas;
import java.awt.Graphics;
import java.awt.image.BufferStrategy;
import java.awt.image.BufferedImage;
import java.awt.image.DataBufferInt;
public class test extends Canvas{
public static JFrame frame;
public static int WIDTH = 800;
public static int HEIGHT = 600;
public test(){
}
public static void main(String[] a){
test t=new test();
frame = new JFrame("WINDOW");
frame.add(t);
frame.pack();
frame.setVisible(true);
frame.setSize(WIDTH, HEIGHT); …Run Code Online (Sandbox Code Playgroud) 我有这个:
import javax.swing.*;
import java.awt.Canvas;
import java.awt.image.BufferedImage;
public class test extends Canvas{
public static JFrame frame;
public static int WIDTH = 800;
public static int HEIGHT = 600;
public static BufferedImage img;
public static int[] pixels;
public static boolean running=true;
public static void main(String[] a){
img = new BufferedImage(WIDTH, HEIGHT,BufferedImage.TYPE_INT_RGB);
frame = new JFrame("WINDOWw");
frame.add(new JLabel(new ImageIcon(img)));
frame.pack();
frame.setVisible(true);
frame.setSize(WIDTH, HEIGHT);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}
Run Code Online (Sandbox Code Playgroud)
如何阻止黑色图像自动居中于画面?
java ×4
javascript ×4
image ×3
android ×2
cordova ×2
draw ×2
events ×2
jquery ×2
swing ×2
webgl ×2
3d ×1
append ×1
arrays ×1
awt ×1
canvas ×1
css ×1
css3 ×1
cube ×1
date ×1
date-fns ×1
editor ×1
firefox ×1
flexbox ×1
geometry ×1
gradle ×1
html5 ×1
jekyll ×1
jframe ×1
jlabel ×1
json ×1
mobile ×1
normals ×1
permissions ×1
ruby ×1
time-format ×1
todataurl ×1