Method:
The general method is the same as the RGB zoom. Note that when you click the left mouse button to zoom in on the ddraw YUV video, the height and width of the ddraw surface may change, in this way, we need to zoom in and out with the new ddraw surface in time. When YUV is scaled and displayed, two objects access the members (coordinates) of the same class due to data interaction between several classes) cannot obtain the coordinate value. This problem can be solved using the single-State design mode in the design mode or using getparent () to obtain the objects in the parent class dialog box.
The scaling formula is as follows:
Imgrect:
Based on the magnification and the position of the scroll bar, determine which part of the pixels of the original image are displayed on the screen.
Calculate the relationship;
Set the horizontal position of the scroll bar to Sx, and the vertical position to Sy;
The screen size is CX, Cy
The magnification is m_zoom;
At this time, the coordinates of the corresponding original pixels are:
Pixel size = I _width * I _height;
In this case, the local original size is (RGB scaling ):
Imgrect. Left = (I _width-cx/m_zoom) * SX/max_scrollvalue;
Imgrect. Top = (I _height-cy/m_zoom) * SY/max_scrollvalue;
Imgrect. width = Cx/m_zoom;
Imgrect. Height = cy/m_zoom;