导航:首页 > 文字图片 > 图片框显示文字的代码

图片框显示文字的代码

发布时间:2023-07-18 02:23:49

‘壹’ vb 题中在图片框中显示文字怎么

Picture1.print "文字文字"

‘贰’ DIV CSS鼠标悬停在没有文字内容图片上时图片下方显示文字

加个 title 试试,或者是 写个 浮层

‘叁’ 【求教】用html代码制作 鼠标点击图片的时候出现图片框并在图片上显示文字

不知道这个是不是你要找的。

<head><style type="text/css">
#floater {
position: absolute;
left: 500;
top: 146;
width: 125;
visibility: visible;
z-index: 10;
}</style>
</head>

<body>

<div ID="floater" style="left: 590px; top: 158px">
<p align="center"><img SRC="2259.gif" alt="图片显示的文字" WIDTH="150" HEIGHT="60"><br>
<font color="#FF8040">网页特效</font></p>
</div><script LANGUAGE="JavaScript">
self.onError=null;
currentX = currentY = 0;
whichIt = null;
lastScrollX = 0; lastScrollY = 0;
NS = (document.layers) ? 1 : 0;
IE = (document.all) ? 1: 0;
<!-- STALKER CODE -->
function heartBeat() {
if(IE) { diffY = document.body.scrollTop; diffX = document.body.scrollLeft; }
if(NS) { diffY = self.pageYOffset; diffX = self.pageXOffset; }
if(diffY != lastScrollY) {
percent = .1 * (diffY - lastScrollY);
if(percent > 0) percent = Math.ceil(percent);
else percent = Math.floor(percent);
if(IE) document.all.floater.style.pixelTop += percent;
if(NS) document.floater.top += percent;
lastScrollY = lastScrollY + percent;
}
if(diffX != lastScrollX) {
percent = .1 * (diffX - lastScrollX);
if(percent > 0) percent = Math.ceil(percent);
else percent = Math.floor(percent);
if(IE) document.all.floater.style.pixelLeft += percent;
if(NS) document.floater.left += percent;
lastScrollX = lastScrollX + percent;
}
}
<!-- /STALKER CODE -->
<!-- DRAG DROP CODE -->
function checkFocus(x,y) {
stalkerx = document.floater.pageX;
stalkery = document.floater.pageY;
stalkerwidth = document.floater.clip.width;
stalkerheight = document.floater.clip.height;
if( (x > stalkerx && x < (stalkerx+stalkerwidth)) && (y > stalkery && y < (stalkery+stalkerheight))) return true;
else return false;
}
function grabIt(e) {
if(IE) {
whichIt = event.srcElement;
while (whichIt.id.indexOf("floater") == -1) {
whichIt = whichIt.parentElement;
if (whichIt == null) { return true; }
}
whichIt.style.pixelLeft = whichIt.offsetLeft;
whichIt.style.pixelTop = whichIt.offsetTop;
currentX = (event.clientX + document.body.scrollLeft);
currentY = (event.clientY + document.body.scrollTop);
} else {
window.captureEvents(Event.MOUSEMOVE);
if(checkFocus (e.pageX,e.pageY)) {
whichIt = document.floater;
StalkerTouchedX = e.pageX-document.floater.pageX;
StalkerTouchedY = e.pageY-document.floater.pageY;
}
}
return true;
}
function moveIt(e) {
if (whichIt == null) { return false; }
if(IE) {
newX = (event.clientX + document.body.scrollLeft);
newY = (event.clientY + document.body.scrollTop);
distanceX = (newX - currentX); distanceY = (newY - currentY);
currentX = newX; currentY = newY;
whichIt.style.pixelLeft += distanceX;
whichIt.style.pixelTop += distanceY;
if(whichIt.style.pixelTop < document.body.scrollTop) whichIt.style.pixelTop = document.body.scrollTop;
if(whichIt.style.pixelLeft < document.body.scrollLeft) whichIt.style.pixelLeft = document.body.scrollLeft;
if(whichIt.style.pixelLeft > document.body.offsetWidth - document.body.scrollLeft - whichIt.style.pixelWidth - 20) whichIt.style.pixelLeft = document.body.offsetWidth - whichIt.style.pixelWidth - 20;
if(whichIt.style.pixelTop > document.body.offsetHeight + document.body.scrollTop - whichIt.style.pixelHeight - 5) whichIt.style.pixelTop = document.body.offsetHeight + document.body.scrollTop - whichIt.style.pixelHeight - 5;
event.returnValue = false;
} else {
whichIt.moveTo(e.pageX-StalkerTouchedX,e.pageY-StalkerTouchedY);
if(whichIt.left < 0+self.pageXOffset) whichIt.left = 0+self.pageXOffset;
if(whichIt.top < 0+self.pageYOffset) whichIt.top = 0+self.pageYOffset;
if( (whichIt.left + whichIt.clip.width) >= (window.innerWidth+self.pageXOffset-17)) whichIt.left = ((window.innerWidth+self.pageXOffset)-whichIt.clip.width)-17;
if( (whichIt.top + whichIt.clip.height) >= (window.innerHeight+self.pageYOffset-17)) whichIt.top = ((window.innerHeight+self.pageYOffset)-whichIt.clip.height)-17;
return false;
}
return false;
}
function dropIt() {
whichIt = null;
if(NS) window.releaseEvents (Event.MOUSEMOVE);
return true;
}
<!-- DRAG DROP CODE -->
if(NS) {
window.captureEvents(Event.MOUSEUP|Event.MOUSEDOWN);
window.onmousedown = grabIt;
window.onmousemove = moveIt;
window.onmouseup = dropIt;
}
if(IE) {
document.onmousedown = grabIt;
document.onmousemove = moveIt;
document.onmouseup = dropIt;
}
if(NS || IE) action = window.setInterval("heartBeat()",1);
</script>
</boyd>

‘肆’ js点击图片在文本框内显示文字

亲,改一下js代码,改成这样就可以了

<scripttype="text/javascript">
tb=document.getElementById('textbox');
spans=document.getElementsByTagName("span");
for(vari=0;i<spans.length;i++)
{
spans[i].index=i;
spans[i].onclick=function()
{
alert(spans[this.index-1].innerHTML);
}
}
</script>

‘伍’ 如何在vb中的图片框中加入文字

picture1.print"Demo"

第二种方法

"gdi32"Alias"TextOutA"(ByValhdcAsLong,ByValxAsLong,ByValyAsLong,ByVallpStringAsString,ByValnCountAsLong)AsLong

privatesubPicture1_Click()
dimSasstring
s="DEMO"
picture1.cls
TextOutpicture1.hdc,10,10,s,len(s)
picture1.refresh
endsub

‘陆’ VB的图片框中怎么样显示字符

假如图片框的名称是Picture1,则用下列语句在图片框上输出字符:
Picture1.Print
"我爱你!"

阅读全文

与图片框显示文字的代码相关的资料

热点内容
担心的图片带文字 浏览:236
蝴蝶男生动漫头像图片大全 浏览:46
小朋友齐刘海图片女可爱 浏览:423
女生小小便的地方图片 浏览:318
怀孕的衣服图片 浏览:975
美女吃男生的卵子图片 浏览:886
怎么样用图片搜索图片 浏览:566
关于美女不穿衣服的图片 浏览:971
可爱卡通游戏图片 浏览:396
蔡琳短发发型图片欣赏 浏览:110
word怎么把表格图片放满 浏览:776
小孩舞蹈发型图片 浏览:440
汉代酒杯价格图片 浏览:37
新生儿图片可爱照片 浏览:295
高大肥胖美女毛耸耸性生活图片 浏览:496
抠图动漫素材图片素材 浏览:984
棕红色男生图片 浏览:235
canva如何导入图片 浏览:804
挂衣服挂袋图片大全 浏览:168
美女铂金首饰图片 浏览:567