Jump to content
Software FX Community

How to set Chartfx's HDC Pen


User (Legacy)

Recommended Posts

Hi,

I am doing a bit of drawing using lineto on the chartfx HDC.

I use

SetROP2 lngHDC, DrawModeConstants.vbInvert

To try and set the pen to be an inverted one, but this seems to accomplish

nothing.

I also try

hRPen = CreatePen(PS_DOT, 1, vbBlack)

DeleteObject SelectObject(lngHDC, hRPen)

To try and set the pen to a dotted line; however, this fails as well.

I use both of these commands between dc commands, likebelow.

lngHDC = ChartFX.PaintInfo(CPI_GETDC)

'Code to modify pen here

ChartFX.PaintInfo CPI_RELEASEDC, lngHDC

What am I doing wrong?

Thanks,

Chase

Link to comment
Share on other sites

I am doing this in the mousemove event. Visually, I am drawing "rubberband"

lines to indicate where a custom drawing feature will be placed.

Is it possible for me to modify the pens at all, at any point?

Thanks,

Chase Gale

"SoftwareFX Support" <support@softwarefx.com> wrote in message

news:jyVYnZsfDHA.3064@WEBSERVER1...

> Where are you doing this code ? Chart FX uses multiple pens to draw

> different objects. You can not affect Chart FX's drawing by changing the

pen

> of a "temporary" hDC.

>

> Can you explain what are you trying to achieve visually ?

>

> --

> FP

> Software FX, Inc.

>

>

Link to comment
Share on other sites

Not directly the pens. No.

You can modify the attributes of Chart Lines using LineStyle, LineWidth,

etc. We will use these to create our pens.

If you are drawing a "rubberband" then you are doing the drawing and you

don't need to modify the pens Chart FX uses to draw.

So, what you want to do is something like:

lngHDC = ChartFX.PaintInfo(CPI_GETDC)

'Code to modify pen here

' CODE TO PAINT RUBBERBAND HERE

ChartFX.PaintInfo CPI_RELEASEDC, lngHDC

--

FP

Software FX, Inc.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...