我有一个人体骨骼的图像,有大约60个区域,我想要突出显示并使其可点击.它们是一个圆圈,编号为1-60.
整个想法是我想点击nubmers(在图像上)并突出显示该部分图像.
我已经使用JQuery将鼠标悬停在数字/区域上并突出显示(用鼠标悬停),当用户点击数字时,我将获得点击的数字并处理服务器端代码.(.NET C#)
但是我希望我点击的地方应该保持颜色...将数字悬停在数字上并改变颜色工作正常......但是我想要点击颜色应该在图像上更改/持久...
下面是使用鼠标悬停时更改颜色的示例,但是单击时颜色不会更改.
http://davidlynch.org/js/maphilight/docs/
http://davidlynch.org/js/maphilight/docs/demo_simple.html
任何想法如何突出图像上的一些区域?
示例代码如下:
<img class="map" src="Images/Figure_Human_Image1.png" alt="" usemap="#Skeleton17" / >
<map name="Skeleton17" >
<area title="1" alt="1" href="#" shape="circle" coords="13,174,7" / >
<area title="2" alt="2" href="#" shape="circle" coords="27,159,7" / >
Run Code Online (Sandbox Code Playgroud)
这是我的第一个问题,但我正在试图正确地提问.
由于标题只在一个按钮上说,只在android 3.1中,findViewById(int)返回null.在Android 2.2上测试它可以工作,所有其他按钮都可以在两个Android版本中找到.它在此特定行之前和之后找到按钮.
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button buttonInfo = (Button)findViewById(R.id.buttonInfo);//fine
buttonInfo.setOnClickListener(this);
...
Button buttonCallOpScreen = (Button)findViewById(R.id.buttonCallOpScreen);//always returns null in android 3.1
...
Button buttonTakePicture = (Button)findViewById(R.id.buttonTakePictureMain);//fine
buttonTakePicture.setOnClickListener(this);
}
Run Code Online (Sandbox Code Playgroud)
main.xml:
(我知道我不应该使用px它,但它只能在我的设备上工作,因此这种情况很好.)
<Button
android:id="@+id/buttonInfo"
android:text=""
android:layout_width="332px"
android:layout_height="100px"
android:background="@drawable/btn_team" />
...
<Button
android:id="@+id/buttonCallOpScreen"
android:text=""
android:layout_width="332px"
android:layout_height="100px"
android:background="@drawable/btn_operator" />
...
<Button
android:id="@+id/buttonTakePictureMain"
android:text=""
android:layout_width="80px"
android:layout_height="80px"
android:background="@drawable/btn_take_picture"
android:layout_gravity="bottom|left" />
Run Code Online (Sandbox Code Playgroud)
到目前为止,任何帮助将不胜感激.
回答:
事实证明这不仅仅是丑陋的.由于有几个人在这个项目上工作,似乎在layout-normal/main.xml中更改了一个名称.虽然3.1之前的Android-Versions似乎加载layout/main.xml,但较新的版本使用layout-normal/main.xml.因为如果该按钮的id是不同的findViewById(int)必须返回null,这是可以理解的.
很抱歉打扰你,谢谢你的评论!
由于我的声誉不到100,我无法回答我自己的问题关闭它,如果有人能发布这个答案我会接受它,谢谢.
为什么以下会导致编译错误?
interface IX {}
interface IY {}
class XY : IX, IY {}
void Foo<T>() where T : IX, IY
{
T xy = new XY();
… // ^^^^^^^^
} // error: "Implicit conversion of type 'XY' to 'T' is not possible."
Run Code Online (Sandbox Code Playgroud)
注意:如果class XY : IX和,将发生相同的错误where T : IX.不过,我已经选择了一个更复杂的例子,因为一个简单的一个可能引发circumventive答案,如,"只要改变的类型xy从T到IX",这不会回答为什么这个转换失败.
我正在构建一个带有a的C#应用程序,WebBrowser我正试图找出一种方法来阻止图像,即它们在网站加载时不显示(这样网站加载更容易).
我试图<img>通过获取标记webBrowser1.DocumentText并使用Regex.Replace删除图像来删除标记,但是aaa当我使用代码时它会显示一个空白页面.有没有更好的方法来删除图像?任何帮助非常感谢.
码:
var html_source = webBrowser1.DocumentText;
var newOne = Regex.Replace(html_source, "<img.*/>", "", RegexOptions.Multiline);
webBrowser1.DocumentText = newOne + "aaa";
Run Code Online (Sandbox Code Playgroud)
更新:
我试过下面的代码(仅用于测试),但仍然只是向我展示aaa.
var html_source = webBrowser1.DocumentText;
webBrowser1.DocumentText = html_source + "aaa";
Run Code Online (Sandbox Code Playgroud) 我在C#中写了一个LINQ
string etXML = File.ReadAllText("ET_Volume.xml");
string[] allLinesInAFile = etXML.Split('\n');
var possibleElements = from line in allLinesInAFile
where !this.IsNode(line)
select new { Node = line.Trim() };
string[] xmlLines = possibleElements.ToArray<string>();
Run Code Online (Sandbox Code Playgroud)
问题出现在最后一行,出现以下错误:
System.Collections.Generic.IEnumerable<AnonymousType#1>不包含定义,ToArray并且最好的扩展方法重载System.Linq.Enumerable.ToArray<TSource>(System.Collections.Generic.IEnumerable<TSource>)有一些无效的参数实例参数:无法转换
System.Collections.Generic.IEnumerable<AnonymousType#1>为System.Collections.Generic.IEnumerable<string>
什么是错的,什么是我的转换方法var为string[]?
在c#中,我需要能够
因此,例如,我将使用适当的信用连接到\ SOMESYSTEM,并获取本地管理员列表,包括SOMESYSTEM\Administrator,SOMESYSTEM\Bob,DOMAIN\AlanH,"DOMAIN\Domain Administrators".
我已经尝试使用system.directoryservices.accountmanagement但遇到了身份验证问题.有时我得到:
不允许同一用户使用多个用户名与服务器或共享资源建立多个连接.断开与服务器或共享资源的所有先前连接,然后重试.(HRESULT异常:0x800704C3)
以上是尝试,因为有些情况下我根本无法取消映射现有的驱动器或UNC连接.
其他时候我的程序获得UNKNOWN ERROR并且远程系统上的安全日志报告错误675,代码0x19是KDC_ERR_PREAUTH_REQUIRED.
我需要一个更简单,更不容易出错的方法来做到这一点!
我有一个变量,表示UI可以空闲的时间长度.我已选择调用此变量UITimer.我想将变量传递给我的类构造函数,然后将其存储在本地字段中.
做这个套管的正确方法是什么?我们使用参数的通用约定而不是大写.我应该这样做:
uITimer
Run Code Online (Sandbox Code Playgroud)
或这个?
uiTimer
Run Code Online (Sandbox Code Playgroud)
另外,我们为字段做一个下划线和小写的第一个字母.
应该这样声明:
private int _uITimer
Run Code Online (Sandbox Code Playgroud)
或者像这样
private int _uiTimer?
Run Code Online (Sandbox Code Playgroud)
我认为_uiTimer是要走的路(另一种选择似乎很蹩脚)但我有兴趣看看我是否遗漏了什么.
最佳答案是指向一个文档的链接,该文档说缩写词应该在C#命名中保持相同的情况(或类似的东西)
有多可靠mysql_insert_id()在竞争条件下我的意思是,当多个用户同时插入数据时,这个函数会返回真实的ID还是会返回其他用户插入的数据ID?
表引擎是MyISAM。
我有一些正在运行的代码,我想添加一个条件断点,但我只知道如何为现有断点添加条件.例如,如果我在一行C#代码中添加断点,例如F9,我可以右键单击左侧装订线中的断点红点,这样就可以看到这个菜单

从中我可以选择Condition ...打开条件断点设置

但是我想在一个经常调用的函数中插入一个条件断点,条件很少是真的,这样我就可以找出偶然错误触发的原因.我不想停止代码调试,特别是如果它是一个错误,只会在一段时间后显现出来.所以上面的方法是不合适的.当我第一次插入断点时,但在我有机会添加它的条件之前,它将触发并且程序将"中断".
如何将具有关联条件的断点添加到在调试器下运行的代码中作为单个原子操作,即不添加断点然后向其添加条件但是一次添加断点及其条件?
我在将 Node.js 部署到 IIS 时遇到问题web.config:
> <handlers>
> <add name="iisnode-ng-universal" path="dist/server.js" verb="*" modules="iisnode" />
> </handlers>
<rule name="ng-universal" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{HTTP_HOST}" pattern="test" />
</conditions>
<action type="Rewrite" url="dist/server.js" />
</rule>
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
这是我的网络文件树的外观:
我试图给予完全许可IIS_IUSRS,IUSR但它似乎不起作用。像这篇文章建议的那样:
iisnode 在处理请求时遇到错误