| |

VerySource

 Forgot password?
 Register
Search
View: 1021|Reply: 8

Interpretation of the drawing program!

[Copy link]

3

Threads

11

Posts

10.00

Credits

Newbie

Rank: 1

Credits
10.00

 China

Post time: 2020-2-29 18:30:02
| Show all posts |Read mode
This is a piece of code, I hope the experts give detailed comments, thank you!
void CSeismicView :: OnPrepareDC (CDC * pDC, CPrintInfo * pInfo)
{
CScrollView :: OnPrepareDC (pDC, pInfo);
CSeismicDoc * pDoc = GetDocument ();
if (! pDoc-> IfHaveData (index)) return;
if (pDC-> IsPrinting ())
{
   CSize size;
size.cx = (int) ((float) pDoc-> pSeismicData [index]-> nMapWidth * zoomfactor);
size.cy = (int) ((float) pDoc-> pSeismicData [index]-> nMapHeight * zoomfactor);

CRect rect;
GetUpdateRect (&rect, FALSE);
 
 pDC-> SetMapMode (MM_LOMETRIC);
 pDC-> SetWindowOrg (0,0);
}
else
{

CSize size (pDoc-> pSeismicData [index]-> nMapWidthA, pDoc-> pSeismicData [index]-> nMapHeightA);
if ((size.cx == 0) || (size.cy == 0)) return;
Ranch
 pDC-> SetMapMode (MM_TEXT);
 pDC-> SetWindowOrg (0,0);
SetScrollSizes (MM_TEXT, size);
}
}

void CSeismicView :: OnDraw (CDC * pDC)
{
// Beep (1000,100);
CSeismicDoc * pDoc = GetDocument ();
ASSERT_VALID (pDoc);
CView * pView = ((CSeismicFrm *) AfxGetMainWnd ())-> GetActiveView ();
if (pView == this)
{
CRect rect;
GetClientRect (&rect);
CPoint point (0,0);
pDC-> DPtoLP (&point);
rect.left + = point.x;
rect.right + = point.x;
rect.top + = point.y;
rect.bottom = rect.top + 5;
CBrush brush (RGB (255,0,0));
// pDC-> FillRect (&rect,&brush);
brush.DeleteObject ();
}
if (! pDoc-> IfHaveData (index)) return;
// this-> MessageBox ("##", NULL, MB_OK);
pDoc-> pSeismicData [index]-> Draw (pDC, (CView *) this);
pDoc-> pLayerData [index]-> Draw (pDC, (CView *) this);
pDoc-> pFaultData [index]-> Draw (pDC, (CView *) this);
pDoc-> pSeismicData [index]-> DrawGridAndLabel (pDC, (CView *) this);
}
Thank you! !! !! !! !! !! !! !! !! !! !! !! !! !! !! !! !!
Reply

Use magic Report

0

Threads

9

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

Post time: 2020-5-12 01:45:01
| Show all posts
void CSeismicView :: OnPrepareDC (CDC * pDC, CPrintInfo * pInfo)
{
CScrollView :: OnPrepareDC (pDC, pInfo);
CSeismicDoc * pDoc = GetDocument ();
if (! pDoc-> IfHaveData (index)) return;
if (pDC-> IsPrinting ()) === judge whether CDC is used for printing
{
   CSize size; === Relative coordinates or position, below is the coordinate xy
size.cx = (int) ((float) pDoc-> pSeismicData [index]-> nMapWidth * zoomfactor);
size.cy = (int) ((float) pDoc-> pSeismicData [index]-> nMapHeight * zoomfactor);

CRect rect;
GetUpdateRect (&rect, FALSE); == get refreshable area
 
 pDC-> SetMapMode (MM_LOMETRIC); Set the mapping mode
 pDC-> SetWindowOrg (0,0); set coordinate origin
}
else
{

CSize size (pDoc-> pSeismicData [index]-> nMapWidthA, pDoc-> pSeismicData [index]-> nMapHeightA);
if ((size.cx == 0) || (size.cy == 0)) return;
The
 pDC-> SetMapMode (MM_TEXT);
 pDC-> SetWindowOrg (0,0);
SetScrollSizes (MM_TEXT, size); Set scroll bar}
}

void CSeismicView :: OnDraw (CDC * pDC)
{
// Beep (1000,100);
CSeismicDoc * pDoc = GetDocument ();
ASSERT_VALID (pDoc);
CView * pView = ((CSeismicFrm *) AfxGetMainWnd ())-> GetActiveView ();
if (pView == this)
{
CRect rect;
GetClientRect (&rect); == Get the client area
CPoint point (0,0);
pDC-> DPtoLP (&point); == Convert device coordinates to logical coordinates
rect.left + = point.x;
rect.right + = point.x;
rect.top + = point.y;
rect.bottom = rect.top + 5;
CBrush brush (RGB (255,0,0)); == Set brush
// pDC-> FillRect (&rect,&brush); = fill with brush
brush.DeleteObject (); == delete
}
if (! pDoc-> IfHaveData (index)) return;
// this-> MessageBox ("##", NULL, MB_OK);
pDoc-> pSeismicData [index]-> Draw (pDC, (CView *) this);
pDoc-> pLayerData [index]-> Draw (pDC, (CView *) this);
pDoc-> pFaultData [index]-> Draw (pDC, (CView *) this);
pDoc-> pSeismicData [index]-> DrawGridAndLabel (pDC, (CView *) this);
}
==============
Here are some basic functions. Some member functions in the DOC class are called in the view, so there are many pDoc->.
It is recommended that the landlord should lay the mfc foundation and study them again. You can look at the technical insider or explain the MFC and other things in depth. For some basic functions MFC framework documents, it is very simple to look at this program in the future.
Reply

Use magic Report

3

Threads

11

Posts

10.00

Credits

Newbie

Rank: 1

Credits
10.00

 China

 Author| Post time: 2020-5-17 18:30:01
| Show all posts
Thank you!
I'm sorry! Can the above program complete many points? Because I want to find a program to refer to the editor!
If I have millions of points and need to draw hundreds of thousands of lines, can I use this drawing?
Is it slow to use MoveTo and LineTo?
Please advise!
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 Invalid IP Address

Post time: 2020-7-17 11:30:01
| Show all posts
Develop the program you want on this basis
Reply

Use magic Report

3

Threads

11

Posts

10.00

Credits

Newbie

Rank: 1

Credits
10.00

 United States

 Author| Post time: 2020-7-17 14:00:01
| Show all posts
I'm sorry! My foundation may be too bad!
Could you please give me a frame or something upstairs? I still have a hard time doing it myself!
For example, to draw a few downward curves or something! (Is it possible to paste pictures on it?)
Thank you! ! ! ! ! !
Reply

Use magic Report

0

Threads

6

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

Post time: 2020-7-19 10:15:01
| Show all posts
There is no problem drawing one by one, but the seismic data is large due to the large amount of data. It is recommended to use a thread plus cache method to do it; that is, create a thread and draw it in the memory device before displaying it.

In addition, because the energy difference of each point of the seismic data may be relatively large, if the processing is not good, the graph of the displayed seismic trace is not very good, you can consider the root-mean-square method, the maximum method and other balance algorithms to select the display.
Reply

Use magic Report

3

Threads

11

Posts

10.00

Credits

Newbie

Rank: 1

Credits
10.00

 China

 Author| Post time: 2020-7-21 18:30:01
| Show all posts
Wow!zrl8668is amazing!
Actually, I don't quite understand the thread you mentioned. Can you give me an example? Because the first contact is very confused!
Reply

Use magic Report

0

Threads

57

Posts

27.00

Credits

Newbie

Rank: 1

Credits
27.00

 China

Post time: 2020-7-27 01:00:01
| Show all posts
If the data is too large, it is better to directly manipulate the bitmap data
Reply

Use magic Report

3

Threads

11

Posts

10.00

Credits

Newbie

Rank: 1

Credits
10.00

 China

 Author| Post time: 2020-8-2 21:00:01
| Show all posts
Can you give me an example to explain to the experts! please!
You say that, I don't understand!
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list