绘制xor线 [英] Drawing xor lines

查看:79
本文介绍了绘制xor线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我看来,Net(VB2005 Pro)最糟糕的失败之一并非

提供XOR线条绘制功能,如VB6所示。


我的应用程序的一个主要功能是允许用户在迹线上绘制标记(垂直

行),这样他们就可以测量标记之间的时差。


一旦他们点击了所需的位置,在跟踪上,箭头按钮就会提供,因此他们可以将标记移动到一个确切的位置。使用xor,我只需

重绘当前标记使其消失然后绘制一个新的标记一个

像素的距离。在VB6中没有汗水。


我在我的网站上放了一个带有标记的典型痕迹的屏幕截图

在私人下。然后点击标记显示 屏幕截图
http://home.surewest.net /galen/index.html


我将非常感谢我能得到的任何指导。


痕迹位于位图上包含在用户控件中。我想

在位图的副本上绘制标记。要移动标记,我会将原始位图的新副本放在副本上并在原始位图的新副本上绘制新标记。

这当然会使我的用户控制变得复杂。


此外,最多可显示四个标记。如果我移动一个并扔掉

位图副本,我不仅要绘制新标记,而且我必须重绘其他三个没有移动的




正如您在屏幕截图中看到的那样,标记还会显示一些文字(时间

标记之间的差异)。这意味着我不能只是在垂直集中读取

像素,然后在标记移动时恢复它们。


我可以读取垂直矩形与最坏的情况一样宽

文本大小。


此外,当标记接近屏幕的右边缘时,文本被放置

在标记的左边。


帮助


GalenS

In my opinion, one of the worst failures of Net (VB2005 Pro) was not
providing an XOR line draw feature, as in VB6.

A major feature of my app is allowing the user to draw Markers (vertical
lines) on a trace so they can measure the time difference between markers.

Once they click on a desired location, on a trace, arrow buttons are
provided so they can move the marker to an exact location. With xor, I just
redraw the current marker to make it disappear then draw a new marker one
pixel away. No sweat in VB6.

I have put a screen shot of a typical trace with markers on my web site
under "Private" then click on "Marker display" "screen shot"
http://home.surewest.net/galen/index.html

I would appreciate any guidance I can get.

The traces are on a bitmap which is contained in a User Control. I thought
of drawing the marker on a copy of the bitmap. To move the marker I would
toss the copy and draw the new marker on a new copy of the original bitmap.
This, of course, would complicate my User Control.

Also there can be up to four markers displayed. If I move one and toss the
bitmap copy, I not only have to draw the new marker but I have to redraw the
other three which didn''t move.

As you can see on the screen shot, a marker also shows some text (time
difference between markers). This means I can''t just read in a vertical set
of pixels and later restore them as the marker is moved.

I could read a vertical rectangle which would be as wide as the worst case
text size.

Also, as the marker nears the right edge of the screen, the text is placed
to the left of the marker.

H E L P

GalenS

推荐答案

DrawReversibleFrame()
DrawReversibleFrame()


它就在那里,只是叫做不同的东西,Galen已经说过了,它是'

自.NET 1.0以来一直存在

" Galen Somerville" < GA *** @ community.nospam>在消息中写道

新闻:eA ************** @ TK2MSFTNGP05.phx.gbl ...
it''s there, just called something different, Galen already stated it, it''s
been there since .NET 1.0
"Galen Somerville" <ga***@community.nospam> wrote in message
news:eA**************@TK2MSFTNGP05.phx.gbl...
在我看来,一个Net(VB2005 Pro)最糟糕的故障并没有像VB6那样提供XOR线条绘制功能。

我的应用程序的一个主要功能是允许用户绘制标记(垂直)痕迹上的痕迹,以便他们可以测量标记之间的时差。

一旦他们点击了一个想要的位置,在一条痕迹上,提供了箭头按钮,这样他们就可以了将标记移动到确切位置。使用xor,我只需重新绘制当前标记以使其消失然后绘制一个新标记
一个像素。在VB6中没有汗水。

我已经在我的网站上放置了带有标记的典型痕迹的屏幕截图
在私人下。然后点击标记显示 屏幕截图
http://home.surewest.net /galen/index.html

我很感激我能得到的任何指导。

跟踪位于用户控件中的位图上。我想是在位图的副本上绘制标记。要移动标记,我会将副本折腾并在原始
位图的新副本上绘制新标记。当然,这会使我的用户控制变得复杂。

此外,最多可以显示四个标记。如果我移动一个并折叠
位图副本,我不仅需要绘制新标记,而且我必须重新绘制其他三个没有移动的标记。

正如您在屏幕截图中看到的那样,标记还会显示一些文本(标记之间的时间差异)。这意味着我不能只读取一组垂直的像素,然后在标记移动时恢复它们。

我可以读取一个与它一样宽的垂直矩形。最坏的情况
文本大小。

此外,当标记接近屏幕的右边缘时,文本将放置在标记的左侧。
<帮助

GalenS
In my opinion, one of the worst failures of Net (VB2005 Pro) was not
providing an XOR line draw feature, as in VB6.

A major feature of my app is allowing the user to draw Markers (vertical
lines) on a trace so they can measure the time difference between markers.

Once they click on a desired location, on a trace, arrow buttons are
provided so they can move the marker to an exact location. With xor, I
just redraw the current marker to make it disappear then draw a new marker
one pixel away. No sweat in VB6.

I have put a screen shot of a typical trace with markers on my web site
under "Private" then click on "Marker display" "screen shot"
http://home.surewest.net/galen/index.html

I would appreciate any guidance I can get.

The traces are on a bitmap which is contained in a User Control. I thought
of drawing the marker on a copy of the bitmap. To move the marker I would
toss the copy and draw the new marker on a new copy of the original
bitmap. This, of course, would complicate my User Control.

Also there can be up to four markers displayed. If I move one and toss the
bitmap copy, I not only have to draw the new marker but I have to redraw
the other three which didn''t move.

As you can see on the screen shot, a marker also shows some text (time
difference between markers). This means I can''t just read in a vertical
set of pixels and later restore them as the marker is moved.

I could read a vertical rectangle which would be as wide as the worst case
text size.

Also, as the marker nears the right edge of the screen, the text is placed
to the left of the marker.

H E L P

GalenS





" AMercer" < AM ***** @ discussions.microsoft.com>在消息中写道

新闻:A8 ********************************** @ microsof t.com ...

"AMercer" <AM*****@discussions.microsoft.com> wrote in message
news:A8**********************************@microsof t.com...
DrawReversibleFrame()
DrawReversibleFrame()




这将是一个真正的kludge。 DrawReversibleLine可以用于实际的

标记行。


但是文本怎么样?此外,用户现在可以使用特定的

颜色作为标记。


GalenS



That would be a real kludge. DrawReversibleLine would do for the actual
marker line.

But what about the text? Also the user now has the ability to use a specific
color for the markers.

GalenS


这篇关于绘制xor线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆