DPlot Forum Index DPlot
http://www.dplot.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Displaying plots MFC C++

 
Post new topic   Reply to topic    DPlot Forum Index -> C, C++, C#
View previous topic :: View next topic  
Author Message
Sadbrute



Joined: 26 Apr 2011
Posts: 14

PostPosted: Tue Apr 26, 2011 6:12 pm    Post subject: Displaying plots MFC C++ Reply with quote

I want to display a plot, but when i try to display my picture box (CStatic derived control) Diplot shows first and i have a white bitmap on my picture box. I have implemented ONPaint () on the picture box (it was grey at the beginning and it turns white..) . Does anyone have an idea how to display the actual plot On my picture box ? I do not want a diplot window to pop up.

Code:

void MyPictureCtrl::OnPaint()
   {
      HBITMAP bm=this->GetBitmap();
      if(bm !=0)
      {
         CPaintDC dc(this);
         // device context for painting
         HDC dcmem=::CreateCompatibleDC(dc);

         if (dcmem!=0)
         {
            CBitmap* old = dc.SelectObject((CBitmap*)bm);
            //500,500 just to try         
            ::BitBlt(dc,rect_->left,rect_->top,500,500,dcmem,0,0,SRCCOPY);
            ::SelectObject(dcmem, old);
            ::DeleteObject(dcmem);
         }
         ::ReleaseDC(this->m_hWnd,dc);
      }
   }
Back to top
View user's profile Send private message
DPlotAdmin
Site Admin


Joined: 24 Jun 2003
Posts: 2290
Location: Vicksburg, Mississippi

PostPosted: Tue Apr 26, 2011 7:32 pm    Post subject: Reply with quote

I don't see anything that should prevent the bitmap from being displayed, though I'll look into it more.

As far as DPlot being visible, start it before creating a plot with
DPlot_Start(1,(int *)NULL);
_________________
David Hyde
support@dplot.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    DPlot Forum Index -> C, C++, C# All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group