边框不会在下面的代码中删除,这是图像精灵.我尝试了一些方法来使用样式和边框0删除边框,但没有用.
<style>
img.home{width:40px;height:32px;
background:url(share.png) 0 0;
border-style: none;}
img.next{width:40px;
height:32px;background:url(share.png) -36px 0;
border-style:none;}
</style>
<a href="http://www.yahoo.com/">
<img class="home" border="0">
</a>
<img class="next" border="0"/>
Run Code Online (Sandbox Code Playgroud)
我有一种颜色的课Microsoft.Xna.Framework.Color
.如何更改其色调(或获得略有不同色调的新颜色).我应该将其转换为System.Drawing.Color
,然后以某种方式改变它并转换回来?我无法在任何地方找到任何有用的信息.
编辑 示例:我有红色R:255,G:0,B:0.现在我想要稍微更橙色.然后,如果我得到这种颜色并再次转换它,我会得到更多的橙色,然后经过一些转换,我会去黄色,绿色等.我不知道每种颜色的ARGB的确切值,我不知道需要它们.我只需要改变颜色的色调(例如10度).
有没有办法将角色与数学运算符相关联?
例如,如果我可以将字母"b"关联为添加
(b 2 2)
产量
4
这可能吗?如果有,我可以用作指导的材料或例子吗?
我正在尝试编写一些代码来检查先前定义的变量是否有空格,如果有,则用短划线替换空格.这将嵌套在另一个函数中.
function foo(){
// If stateName has a space replaces the space with a dash
window.open('http://website.html/state-solar-policy/' + stateName);
}
Run Code Online (Sandbox Code Playgroud) 我需要能够在事件函数中更改JPanel的大小,然后再次获取大小.看起来JPanel没有更新,直到函数调用完成.我怎样才能得到实际尺寸?这是一个SSCCE:
import java.awt.*;
import java.awt.event.MouseWheelEvent;
import java.awt.event.MouseWheelListener;
import javax.swing.*;
public class Test extends JFrame implements MouseWheelListener{
JPanel p;
Test(){
setLayout(new FlowLayout());
setPreferredSize(new Dimension(1000,1000));
setDefaultCloseOperation(EXIT_ON_CLOSE);
setVisible(true);
p = new JPanel();
p.setPreferredSize(new Dimension(200,200));
p.setBackground(Color.red);
add(p);
addMouseWheelListener(this);
pack();
}
public static void main(String args[]){
new Test();
}
public void mouseWheelMoved(MouseWheelEvent e) {
System.out.println(p.getSize());
p.setPreferredSize(new Dimension(100,100));
p.revalidate();
System.out.println(p.getSize());
}
}
Run Code Online (Sandbox Code Playgroud)
代码工作正常,但如果我滚动鼠标一步,它会在控制台中打印以下内容:
java.awt.Dimension中[宽度= 200,高度= 200]
java.awt.Dimension中[宽度= 200,高度= 200]
我想要它打印:
java.awt.Dimension中[宽度= 200,高度= 200]
java.awt.Dimension中[宽度= 100,高度= 100]
我想,例如,添加一个方法integer
(即Int32
),这将使我能够做到以下几点:
int myInt = 32;
myInt.HelloWorld();
Run Code Online (Sandbox Code Playgroud)
可以说,你可以写一个方法,而不是坚持上面这样做,你可以更容易地使用integer
,HelloWorld(integer)
如下所示:
int myInt = 32;
HelloWorld(myInt);
Run Code Online (Sandbox Code Playgroud)
但是,我只是好奇它是否可能.如果是真的,那么在众所周知的类中添加一些其他功能是一种很好的编程习惯吗?
PS:我试图创建另一个继承自的类Int32
,但不能从密封类型'int'派生.
我有一个我想使用的Skybox,我正在尝试将它应用到我的场景中.当我尝试将它拖到Hierarchy
框中时它不起作用.我尝试将它应用到这里描述的相机,但它没有用.提前致谢.
我正在尝试创建一个Windows窗体项目,并使用Kinect和Windows SDK对Kinect进行语音识别.我有
我把它作为命令提示符,因为它是最简单的方法.无论如何,我已经阅读并发现了两件事.
1)我发现如何在同一个解决方案中同时运行两个项目.
2)我还发现了如何添加引用以从每个项目获取类到另一个项目.
那么,我如何从每个项目中获取变量?只是通过使用项目引用,或什么?P2可以识别语音并将其保存到变量中,如果这对任何事物都有效.
我正在研究一个桌面程序,基本上我只是想在定时器或循环上收集信息,所以每次循环运行它都会保存JSON instagram提供的ID然后转移到网络上,依此类推,我决定只在Json instagram提供的单个图像上进行测试,看起来像这样.
{"pagination":{"next_max_tag_id":"1399847337728968","deprecation_warning":"next_max_id and min_id are deprecated for this endpoint; use min_tag_id and max_tag_id instead","next_max_id":"1399847337728968","next_min_id":"1399847337793336","min_tag_id":"1399847337793336","next_url":"https:\/\/api.instagram.com\/v1\/tags\/snow\/media\/recent?access_token=+49749273.8a6c775.3e8cf314d75045e49ba17263d0bededa\u0026count=1\u0026max_tag_id=1399847337728968"},"meta":{"code":200},"data":[{"attribution":null,"tags":["ilovenorway","hiking","spring","sunny","blaaskjerdigen","bluebird","cloud","clouds","redbullnorge","sun","visit","snow","aalesund","sunnm\u00f8rsalps","nofilter","norway","redbull"],"type":"image","location":{"latitude":62.595061667,"longitude":6.735158333},"comments":{"count":0,"data":[]},"filter":"Normal","created_time":"1399822137","link":"http:\/\/instagram.com\/p\/n3JFAHGTdZ\/","likes":{"count":0,"data":[]},"images":{"low_resolution":{"url":"http:\/\/origincache-ash.fbcdn.net\/10326375_690380867685736_1411474740_a.jpg","width":306,"height":306},"thumbnail":{"url":"http:\/\/origincache-ash.fbcdn.net\/10326375_690380867685736_1411474740_s.jpg","width":150,"height":150},"standard_resolution":{"url":"http:\/\/origincache-ash.fbcdn.net\/10326375_690380867685736_1411474740_n.jpg","width":640,"height":640}},"users_in_photo":[{"position":{"y":0.040625,"x":0.06535948},"user":{"username":"redbullnorge","profile_picture":"http:\/\/images.ak.instagram.com\/profiles\/profile_184192460_75sq_1342379531.jpg","id":"184192460","full_name":"Red Bull Norge"}},{"position":{"y":0.9609375,"x":0.06535948},"user":{"username":"redbull","profile_picture":"http:\/\/images.ak.instagram.com\/profiles\/profile_476322_75sq_1334010289.jpg","id":"476322","full_name":"Red Bull"}}],"caption":{"created_time":"1399822137","text":"#nofilter #blaaskjerdigen #bluebird #cloud #clouds #sun #sunny #hiking #snow #spring #ilovenorway #redbull #redbullnorge #visit #norway #aalesund #sunnm\u00f8rsalps","from":{"username":"jooakimandersen","profile_picture":"http:\/\/images.ak.instagram.com\/profiles \/profile_1246631612_75sq_1396821408.jpg","id":"1246631612","full_name":"Joakim Andersen"},"id":"718082592168556034"},"user_has_liked":false,"id":"718082591723960153_1246631612","user":{"username":"jooakimandersen","website":"","profile_picture":"http:\/\/images.ak.instagram.com\/profiles\/profile_1246631612_75sq_1396821408.jpg","full_name":"Joakim Andersen","bio":"","id":"1246631612"}}]}
Run Code Online (Sandbox Code Playgroud)
我试图从这个json文件中获取信息
WebClient webClient = new WebClient();
var list = webClient.DownloadString("https://api.instagram.com/v1/tags/likeforlike/media/recent?access_token=" + Variables.authtoken + "&count=1");
dynamic parsedList = JsonConvert.DeserializeObject<dynamic>(list);
MessageBox.Show(parsedList.data.count.ToString());
Run Code Online (Sandbox Code Playgroud)
但我无法从中得到任何东西它会加载
MessageBox.Show(parsedList.data.ToString());
Run Code Online (Sandbox Code Playgroud)
很好,但我无法深入了解信息
我写了一个简单的c ++程序test.cpp:
#include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
cout << s << endl;
return 0;
}
Run Code Online (Sandbox Code Playgroud)
为什么runnning gcc test.cpp -o mytest
会给我这些错误,还有更多?
Undefined symbols for architecture x86_64:
"std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string()", referenced from:
_main in cc8rGYVq.o
"std::cin", referenced from:
_main in cc8rGYVq.o
Run Code Online (Sandbox Code Playgroud)