Time:10-25
CodePudding user response:
in what way? Post your drawing code
void CDrawView: : ontouch * pDC (CDC) {CDrawDoc * pDoc=GetDocument (); ASSERT_VALID (pDoc); //TODO: add the draw code for native data here CRect client; PDC - & gt; GetClipBox (the client); CRect the rect=client; GetClientRect (the rect); CMemDC memdc (pDC); The CBrush brush; if(! Brush. CreateSolidBrush (RGB (255255255))) return; Brush. UnrealizeObject (); Memdc. FillRect (client, & amp; Brush); The CBrush brush1; if(! Brush1. CreateSolidBrush (RGB (255255255))) return; CPen pen; if(! Pen. CreatePen (PS_SOLID, 1, RGB (0, 0))) return; The CBrush * pOldBrush; CPen * pOldPen; POldPen=memdc. SelectObject (& amp; Pen); POldBrush=memdc. SelectObject (& amp; Brush1); Int m_nwidth=memdc. GetDeviceCaps (LOGPIXELSX);///horizontal pixel points per inch DrawWell (& amp; Memdc); LoadBmp (& amp; Memdc); Memdc. SetBkMode (TRANSPARENT); }
you can, at the time of each map, the map is calculated according to the position of the scroll bar in the area, and then map, only the line, the specific code realization, you can search: picture control supports a scroll bar display images, this kind of solution, such as the demo can refer to: http://download.csdn.net/detail/u010937817/6025845
Quote: refer to 4th floor lx624909677 response: Every time you can it in the map, the map is calculated according to the position of the scroll bar in the area, and then map, only the line, the specific code realization, you can search: picture control supports scrolling display images, this kind of solution, such as the demo can refer to: http://download.csdn.net/detail/u010937817/6025845 first calculates the whole images used in the mapped memory size, and then determine whether memory space disposable draw a complete picture of graphics, if can be directly allocated memory to the memory size used to draw the whole picture, otherwise, the plot to a certain proportion can be reduced, and then determine whether to draw, if can the size of the allocated memory, or repeated until success does set the size of the allocated memory bitmap, make sure the memory, in the window to redraw, also according to the logic of memory bitmap coordinates and the coordinates of the client area to ensure that the client area within the memory bitmap, and then to copy, like this, and I was using a single document: ,
Every time you can it in the map, the map is calculated according to the position of the scroll bar in the area, and then map, only the line, the specific code realization, you can search: picture control supports scrolling display images, this kind of solution, such as the demo can refer to: http://download.csdn.net/detail/u010937817/6025845
Quote: refer to the sixth floor edenluck response: Quote: refer to 4th floor lx624909677 response: Every time you can it in the map, the map is calculated according to the position of the scroll bar in the area, and then map, only the line, the specific code realization, you can search: picture control supports scrolling display images, this kind of solution, such as the demo can refer to: http://download.csdn.net/detail/u010937817/6025845 first calculates the whole images used in the mapped memory size, and then determine whether memory space disposable draw a complete picture of graphics, if can be directly allocated memory to the memory size used to draw the whole picture, otherwise, the plot to a certain proportion can be reduced, and then determine whether to draw, if can the size of the allocated memory, or repeated until success does set the size of the allocated memory bitmap, make sure the memory, in the window to redraw, also according to the logic of memory bitmap coordinates and the coordinates of the client area to ensure that the client area within the memory bitmap, and then to copy, like this, and I was using a single document: , Single document is there something in particular? Way of drawing are the same, the key is to set the map of the area, or how much you figure the largest
actually a lot of this approach, the manager is similar to the game scene, nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
Page link:https//www.codepudding.com/Softwareengineering/72213.html