Jump to content
Software FX Community

How to set Chartfx's HDC Pen


User (Legacy)
 Share

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...