用c drawrectanglee给矩形描边居然只描了一半?怎么回事

Illustrator 中不闭合的路径如何选择向外描边? - CPC中文印刷社区
◆- Adobe 设计软件 Photoshop、Illustrator、Indesign、FrameMaker、Indesign Server、Pagemaker 等adobe公司出品的平面设计类软件。
等级: 七袋长老
会员ID:77919
注册: , 11:09
现金: 50 金币
资产: 4850 金币
85个帖子获得177次感谢
AI中不闭合的路径如何选择向外描边?
如图左图中的不闭合路径怎么向右边的矩形一样向外描边,路径是不闭合时对齐描边的向内和向外根本就不能用
上传的图像
(25.8 KB, 29 次查看)
等级: 六袋长老
会员ID:44374
注册: , 12:15
现金: 2 金币
资产: 2 金币
53个帖子获得56次感谢
这个是软件规则,就像CDR开放路径不能填充一样。
等级: 五袋长老
会员ID:86751
注册: , 18:37
住址: 深圳
现金: 86 金币
资产: 86 金币
40个帖子获得43次感谢
这个没办法的事。软件也不是万能的...
CPC忠实粉丝
等级: 七袋长老
会员ID:69470
注册: , 19:06
住址: 山城
现金: 9820 金币
资产: 9820 金币
377个帖子获得859次感谢
作者: 骑着羊打狼
如图左图中的不闭合路径怎么向右边的矩形一样向外描边,路径是不闭合时对齐描边的向内和向外根本就不能用
AI中不闭合路径是没有办法向内或向外描边的,要想达到向外描边的效果,可以把它做个闭合路径,然后在把不要的地方做个蒙板,当然你也可以直接扩展,然后在描边。看你自已如何去做……
__________________
=======================================================================================
下列会员向 BO8100 表示感谢:
等待 Email 验证会员
等级: 一袋长老
会员ID:366394
注册: , 08:43
现金: 3 金币
资产: 3 金币
可以先描边了,再减掉你不想要的
等级: 小兄弟
会员ID:257523
注册: , 23:16
现金: 1 金币
资产: 1 金币
可以,用宽度工具,按ALT点线的两边,想内就内想外就外。想多少就出多少。
等级: 小兄弟
会员ID:257523
注册: , 23:16
现金: 1 金币
资产: 1 金币
可以的用宽度工具,
点线时有线宽的两边出现点,就ALT调线宽。
上传的缩略图
您不可以发表新主题
您不可以回复主题
您不可以上传附件
您不可以编辑您的帖子
论坛禁用 HTML 代码 are 禁用
所有时间均为北京时间。现在的时间是 。
律师声明:本站内容,均具有版权,未经书面授权,禁止转载,严禁镜像,违者承担一切后果!
&nbsp 广告联系: &nbsp 站务管理:
Powered by vBulletin& Version 3.6.8Copyright &2004 - 2016, 中印网
Page generated in 0. seconds (67.36% PHP - 32.64% MySQL) with 13 queriesjs实现在图片上画矩形框 - 堕落天使 - ITeye技术网站
博客分类:
@author Darkness
@version 1.0
@date
Function.prototype.bind = function(obj){
var _method =
return function(){
_method.apply(obj, arguments);
DrawRectangle = function(id, onMouseUp, className){
this.IMG = document.getElementById(id);
this.isDraw =
this.isMouseUp =
this.index = 0;
this.currentDrawRectangle =
this.className = classN
this.RectangleDivs = [];
this.debug =
this._onMouseUp = onMouseUp;
this.bindListener();
DrawRectangle.prototype = {
bindListener: function(){
this.IMG.onmousemove = this.dragSize.bind(this);
this.IMG.onmouseup = this.onMouseUp.bind(this);
this.IMG.onmouseout = this.onMouseOut.bind(this);
this.IMG.onmouseover = this.onMouseOver.bind(this);
this.IMG.onmousedown = this.drawLayer.bind(this);
this.IMG.onmouseup = this.onMouseUp.bind(this);
drawLayer: function(){
this.IMG.setCapture(true);
this.isDraw =
this.ismouseup =
this.index++;
var pos = this.getSourcePos();
var x = event.offsetX;
var y = event.offsetY;
var top = y + pos.top - 2;
var left = x + pos.left - 2;
var d = document.createElement("div");
document.body.appendChild(d);
d.style.border = "1px solid #ff0000";
d.style.width = 0;
d.style.height = 0;
d.style.overflow = "hidden";
d.style.position = "absolute";
d.style.left =
d.style.top =
if(this.className) {
d.className = this.classN
d.id = "draw" + this.
if (this.debug) {
//d.innerHTML = "&div class='innerbg'&x:" + x + ",y:" + y + ". img_x:" + img_x + ",img_y:" + img_y + ".&/div&";
this.currentDrawRectangle =
this.RectangleDivs[this.index] = {
left: left,
getSourcePos: function(){
return this.getAbsolutePosition(this.IMG);
dragSize: function(){
if (this.isDraw) {
if (event.srcElement.tagName != "IMG")
var pos = this.getSourcePos();
var img_x = pos.
var img_y = pos.
var x = event.offsetX;
var y = event.offsetY;
var drawW = (x + img_x) - this.RectangleDivs[this.index].
var drawH = (y + img_y) - this.RectangleDivs[this.index].
this.currentDrawRectangle.style.width = drawW & 0 ? drawW : -drawW;
this.currentDrawRectangle.style.height = drawH & 0 ? drawH : -drawH;
if (drawW & 0) {
this.currentDrawRectangle.style.left = x + img_x;
if (drawH & 0) {
this.currentDrawRectangle.style.top = y + img_y;
if (this.debug) {
this.currentDrawRectangle.innerHTML = "&div class='innerbg'&x:" + x + ",y:" + y +
". img_x:" +
",img_y:" +
". drawW:" +
",drawH:" +
Dleft[i]:" +
this.RectangleDivs[this.index].left +
",Dtop[i]:" +
this.RectangleDivs[this.index].top +
event.srcElement.tagName +
".&/div&";
stopDraw: function(){
this.isDraw =
onMouseOut: function(){
if (!this.isMouseUp) {
this.isDraw =
onMouseUp: function(){
this.isDraw =
this.isMouseUp =
this.IMG.releaseCapture();
if(this._onMouseUp) {
this._onMouseUp.call(this, this.currentDrawRectangle);
onMouseOver: function(){
if (!this.isMouseUp) {
this.isDraw =
getAbsolutePosition: function(obj){
var t = obj.offsetT
var l = obj.offsetL
var w = obj.offsetW
var h = obj.offsetH
while (obj = obj.offsetParent) {
t += obj.offsetT
l += obj.offsetL
测试页面:
&!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&
&html xmlns="http://www.w3.org/1999/xhtml"&
&meta http-equiv="Content-Type" content="text/ charset=gb2312" /&
&title&DrawRectangle&/title&
&style type="text/css"&
margin-top: 0
margin-left: 0
padding:0;
.innerbg {
background:#ff0000;
filter:Alpha(Opacity=40, FinishOpacity=90, Style=0, StartX=0, StartY=0, FinishX=100, FinishY=100);
width:100%;
height:100%;
&script language="javascript" type="text/javascript" src="DrawRectangle.js"&&/script&
window.onload = function() {
new DrawRectangle('bigimg', function(div){
alert(div.outerHTML);
&img src="test.gif" name="bigimg" border="0" id="bigimg" style="margin-left:0margin-top:0border:1px solid #" &
@version 1.1
@description 采用div替换原来的img作为画布,修复不兼容其他浏览器bug
@author Darkness
@date
问题:1.0版本中采用IMG.setCapture(true);方式在图片上实现鼠标拖动等事件监听,该方式在最新的ie9下行不通,也不兼容其他浏览器
改进:采用一个div作为画布替换原来的img,将img作为其背景并删除原来的img,然后监听div上的鼠标拖动等事件达到原来同样的效果,此方式兼容其他浏览器
DrawRectangle = function(id, onMouseUp, className){
document.oncontextmenu=function() {
this.IMG = document.getElementById(id);
var masker = document.createElement("div");
masker.id = "mask_" +
var position = this.getAbsolutePosition(this.IMG);
masker.style.width = position.width + "px";
masker.style.height = position.height + "px";
masker.style.left = position.
masker.style.top = position.
masker.style["background-image"] = "url("+this.IMG.src+")";
masker.className = "imgmasker";
this.masker =
this.IMG.parentNode.appendChild(masker);
this.IMG.parentNode.removeChild(this.IMG);
this.isDraw =
this.isMouseUp =
this.index = 0;
this.currentDrawRectangle =
this.className = classN
this.RectangleDivs = [];
this.debug =
this._onMouseUp = onMouseUp;
this.bindListener();
DrawRectangle.prototype = {
bindListener: function(){
this.masker.onmousemove = this.dragSize.bind(this);
this.masker.onmouseup = this.onMouseUp.bind(this);
this.masker.onmouseout = this.onMouseOut.bind(this);
this.masker.onmouseover = this.onMouseOver.bind(this);
this.masker.onmousedown = this.drawLayer.bind(this);
this.masker.onmouseup = this.onMouseUp.bind(this);
drawLayer: function(){
//this.IMG.setCapture(true);
this.isDraw =
this.ismouseup =
this.index++;
var pos = this.getSourcePos();
var x = event.offsetX;
var y = event.offsetY;
var top = y + pos.top - 2;
var left = x + pos.left - 2;
var d = document.createElement("div");
// document.body.appendChild(d);
this.masker.appendChild(d);
d.style.border = "1px solid #ff0000";
d.style.width = 0;
d.style.height = 0;
d.style.overflow = "hidden";
d.style.position = "absolute";
d.style.left = left + "px";
d.style.top = top + "px";
d.style.opacity = 0.5;
d.style["z-index"] = 2;
if(this.className) {
d.className = this.classN
d.id = "draw" + this.
if (this.debug) {
d.innerHTML = "&div class='innerbg'&x:" + x + ",y:" + y + "..&/div&";
this.currentDrawRectangle =
this.RectangleDivs[this.index] = {
left: left,
getSourcePos: function(){
return this.getAbsolutePosition(this.masker);
dragSize: function(){
if (this.isDraw) {
if (!(event.srcElement.tagName.toLowerCase() == "div" && event.srcElement.className == "imgmasker"))
var pos = this.getSourcePos();
var img_x = pos.
var img_y = pos.
var x = event.offsetX;
var y = event.offsetY;
var drawW = (x + img_x) - this.RectangleDivs[this.index].
var drawH = (y + img_y) - this.RectangleDivs[this.index].
this.currentDrawRectangle.style.width = (drawW & 0 ? drawW : -drawW) + "px";
this.currentDrawRectangle.style.height = (drawH & 0 ? drawH : -drawH) + "px";
if (drawW & 0) {
this.currentDrawRectangle.style.left = (x + img_x) + "px";
if (drawH & 0) {
this.currentDrawRectangle.style.top = (y + img_y) + "px";
if (this.debug) {
this.currentDrawRectangle.innerHTML = "&div class='innerbg'&x:" + x + ",y:" + y +
". img_x:" +
",img_y:" +
". drawW:" +
",drawH:" +
Dleft[i]:" +
this.RectangleDivs[this.index].left +
",Dtop[i]:" +
this.RectangleDivs[this.index].top +
event.srcElement.tagName +
",this.isDraw: " + this.isDraw +
",this.isMouseUp: " + this.isMouseUp +
".&/div&";
stopDraw: function(){
this.isDraw =
onMouseOut: function(){
if (!this.isMouseUp) {
this.isDraw =
onMouseUp: function(){
this.isDraw =
this.isMouseUp =
//this.IMG.releaseCapture();
if(this._onMouseUp) {
this._onMouseUp.call(this, this.currentDrawRectangle);
onMouseOver: function(){
if (!this.isMouseUp) {
this.isDraw =
getAbsolutePosition: function(obj){
var t = obj.offsetT
var l = obj.offsetL
var w = obj.offsetW
var h = obj.offsetH
while (obj = obj.offsetParent) {
t += obj.offsetT
l += obj.offsetL
&!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&
&html xmlns="http://www.w3.org/1999/xhtml"&
&meta http-equiv="Content-Type" content="text/ charset=gb2312" /&
&title&DrawRectangle&/title&
&style type="text/css"&
margin-top: 0
margin-left: 0
padding:0;
.innerbg {
background:#ff0000;
filter:Alpha(Opacity=40, FinishOpacity=90, Style=0, StartX=0, StartY=0, FinishX=100, FinishY=100);
width:100%;
height:100%;
div.imgmasker {
z-index: 1;
background:#000000;
opacity: 1;
&script language="javascript" type="text/javascript" src="arkjs/lang.js"&&/script&
&script language="javascript" type="text/javascript" src="DrawRectangle.js"&&/script&
window.onload = function() {
new DrawRectangle('bigimg', function(div){
//alert(div.outerHTML);
&img src="test.jpg" name="bigimg" border="0" id="bigimg" style="margin-left:0margin-top:0border:1px solid #"/&
depravedangel
浏览: 308626 次
来自: 南京
[list][*]引用[u][/u][/list]
您好!用的的是3.2.3版本,按照您的方法配置了一下,但是还是 ...
我把xDarkness-MultClrBubble-1.0.j ...
求源码,楼主好人,,谢谢
求源码,楼主好人为什么ps圆角矩形工具用图层样式描边,边角很虚?
您的位置: >>
>> 话题内容
您是第 9584 位浏览者 / 有 2 条回复
7年前 发表1F
麻烦大家帮忙下!!为什么我用矩形选框工具框出一个矩形在描边之后。他的描边是实的。。。可是用矩形工具框出一个矩形在描边之后,描边却很虚。。描边上多是了一个1像素半透明的描边色??我又试这用圆角矩形工具画了很多个圆角矩形之后,有一次上描边后发现描边是实的之后在怎么画,上完描边后多是虚的,多是多了一个1像素半透明的描边色?请问,我想让图层样式里面描边出来多是实的要怎么做??麻烦大家帮忙下。谢谢!!!!图看不到了换放在附件里。。。[&本帖最后由&&于&&19:26&编辑&]
7年前 发表2F
图片现在挂了看不到了。早上还可以的。。网上找到了答案了,在100%的缩放倍数下绘制就不会出线这样的问题了。。地址:希望有其他答案的告诉下谢谢!!!
站酷讨论组
你未加入讨论组,无法在本组发言!
简介:Photoshop是Adobe公司旗下最为出名的图像处理软件之一,集图像扫描、编辑修改、图像制作、广告创意,图像输入与输出于一体的图形图像处理软件,深受广大平面设计人员和电脑美术爱好者的喜爱。

我要回帖

更多关于 drawrect 的文章

 

随机推荐