CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Hybrid View

  1. #1
    Join Date
    Aug 2014
    Posts
    1

    how to paint the graph area in VC++

    Hi,

    I'm VC++ learner/beginner.

    I have a MFC SDI application which will draw the graph from the given data points.

    Now I want to add two features to my application.

    1. I want to paint the graph region not the whole graph frame. I have attached pic which I want to get from my application.

    Name:  Shaded graph.png
Views: 948
Size:  2.4 KB

    2. I want to read the binary format file and read the data points to draw the graph.

    here we have used DirectX to draw the graph.

    Kindly provide your suggestions to solve this issue.

  2. #2
    Join Date
    Apr 2000
    Location
    Belgium (Europe)
    Posts
    4,626

    Re: how to paint the graph area in VC++

    1) draw the graph, close it. then use a floodfill.

    2) don't draw the upper graph line, rather, draw decenderlines from the graph point down(up) to the the X axis (you can also view this as drawing a bar chart where each bar is 1 pixel wide).

    3) use a polygon 'including decenders for the left and right edge down (up) to the x-axis and the X axis. rather than a polyline for just the graph points.
    Only this option will work reliably if you want to draw to a printer DC directly.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured