The code is as follows:[CPP]View Plaincopyprint?
Xxx::xxx (qwidget *parent/ * = 0 */)
{
..................
//Note that resize must be placed in front of this code
Resize (300, 300);
int CX, CY;
//When the parent is empty, the window is displayed in the center of the desktop
if (NULL = = parent)
{
CX = (qapplication::d esktop ()->width ()-width ())/2;
cy = (qapplication::d esktop ()-
Rectangular svgversion= "1.1"Baseprofile= "full"width= "+"Height= "$"> rectx= " the"y= " the"Rx= "5"ry= "5"width= "+"Height= "+"Fill= "Teal" />svg>1.x:Defines the point in the upper-left corner of the rectangle.xCoordinates 2, Y: Defines the y-coordinate of the point at the upper-left corner of the rectangle 3, Rx: Defines the X-direction fillet radius of Four corners of the rectangle 4, ry: Defines the Y-direction fillet radius Four, Width: Defines the width of the rectangle 5, Height: Defin
This article mainly introduces PHP using GD2 to draw the geometry, combined with the example form analysis of the common functions involved in GD2 drawing and specific use of skills, the need for friends can refer to the following
This example describes how PHP uses GD2 to draw geometry. Share to everyone for your reference, as follows:
You can use the GD2 function not only to draw line shapes, but also to draw fill shapes, such as filled circles, filled rectangles, and so on. The following is
.
Imageellipse -- draw an ellipse?? Syntax: boolimageellipse (resource image, intcx, intcy, intw, inth, intcolor)?? Imageellipse () draws an elliptic with the Center cx and cy (0, 0 in the upper left corner of the image) in the image. W and h respectively specify the width and height of the ellipse, and the color of the ellipse is specified by color.?? Imagefilledellipse -- draw an ellipse and fill it?? Syntax: boolimagefilledellipse (resource image,
cx, int cy, H MENU hMenu) {if (Getsuperclassname ()! = NULL ! Registersuperclass ()) Return null;if (getsuperclassname () = = NULL ! Registerwindowclass ()) Return Null;m_hwnd =:: CreateWindowEx (dwExStyle, Getwindowclassname (), Pstrname, DwStyle, X, Y, C X, CY, hWndParent, HMenu, Cpaintmanagerui::getinstance (), this); ASSERT (m_hwnd!=null); return m_hwnd;}You can see the end use of the CreateWindowEx fu
Create a new MFC project.are as follows:Maximize and minimize each turn on. This is the program.How to let the program follow the size itself changes. Add a variable to the control first.Add a response message to the window at the same time.voidCghostdlg::onsize (UINT NType,intCxintcy) {cdialogex::onsize (NType, CX, CY); if(M_list_oline.m_hwnd!=null)//Change the on- line address size{CRect rc; Rc.left=1;//the left coordinate of the listrc.top= the;
, calculates the x-coordinate bx and y-coordinate by of B, and the y-coordinate of C(assuming the center of the pentagram at the origin of the coordinates)BX = a * cos (* pi/180);by = a * sin (* pi/180);cy =-A * cos (* pi/180);The coordinates of the five points can be simply represented by the above four quantities and some constants.#include ConstGlfloat Pi =3.1415926536f;voidMydisplay (void) {Glfloat a=1/ (2-2*cos ( the*pi/ the)); Glfloat BX= A * co
How to change the csplitterwnd size
WriteProgramIn the interface, I use csplitterwnd to divide the window into two upper and lower windows. However, when the program is scaled or maximized, the window below the split bar is enlarged and reduced, but what I need is to zoom in and out the window above the split bar.
I intercepted the wm_size message of cchildframe. Here, I re-calculate the size of the two split windows so that the height of the windows under the split windows remains unchanged
class, and select "generic cwnd" as the base class. The class name is cclientwnd;Step 3: Add onerasebkgnd (CDC * PDC )(Wm_erasebkgnd), Onsize (uint ntype, int CX, int CY )(Wm_size) Function overload (Class Wizard), and add the virtual function wndproc * cclientwnd: getsuperwndprocaddr ():
Bool cclientwnd: onerasebkgnd (CDC * PDC)
{// Todo: add your message handler code here and/or call defaultCrect rectbk; // size of the customer ZoneCDC dcmen; //
on the interface. You can determine from which vertex to flip fy = cornerY when your fingers fall; gx = (ax + fx)/2; // The G point is the midpoint gy = (ay + fy)/2 of af; float gm = fy-gy; float mf = fx-gx; float em = gm * gm/mf; // calculate the em length ex = gx-em based on the similarity triangle; // calculate the epoint ey = fy; float hm = mf * mf/gm; hx = fx; hy = gy-hm; // Similarly, calculate the h point cx = ex-(fx-ex)/2; // Similarly, the triangle ehf is similar to the triangle cjf, a
chess knight.Obtain the attack range as much as possible, and check whether it is the same as the source image.#include
#include
#include
#include#include
#include
#include
#include
#include
#include
using namespace std;#define For(i,n) for(int i=1;i
=0;i--)#define Forp(x) for(int p=pre[x];p;p=next[p])#define Lson (x
> v;int
of a flag bit through binary bit.
2. If no flag is displayed in the register window, right-click the register window and select "flag" to display the flag value, as shown in the following figure:OV =? UP =? EI =? PL =? ZR =? AC =? PE =? CY =?
Here is a comparison table:
You can compare the bit values of each flag Based on the binary data of EFL.
We can see each value of the flag at the starting breakpoint:OV = 0 UP = 0 EI = 1 PL = 0 ZR = 0 AC = 0 PE
SetForeGroudWindow (int hwnd) method to activate it and set it to the foreground window, however, if you only want to activate it without setting it as the foreground, you need to use the SetActiveWindow () function ()
However, you must note that this method does not work when activating the current thread form in other threads.
To make the target form and other forms appear on the desktop at the same time, make sure that only the target form is active, that is to say, only the target form can
The meaning of this question is to give you n related points, represented by A-I, and then given n-1 rows, the I-th line represents the relevant information from vertex I to other points.Based on the given map, we need to select an appropriate route so that all given points can reach any other point. The problem is of small scale and the direct matrix is used.Storage, using the prim algorithm. 1 # include 2 # include 3 # include 4 # include 5 using namespace std;67 const int MAX = 0x7ffffff;8 in
of the rectangle border.
The stroke attribute of CSS defines the color of the rectangle border.
The x property defines the left position of the rectangle (for example, x = "0" defines the distance between the rectangle and the left side of the browser window is 0 px)
The y property defines the top position of the rectangle (for example, y = "0" defines the distance from the rectangle to the top of the browser window is 0 px)
The fill-opacity attribute of CSS defines the fill color transpa
Android profile picture, android profile pictureDIY round Avatar
Currently, most apps use circular portraits, and there are many open-source images on the Internet. But have you considered DIY circular portraits? Next we will implement one by ourselves. Let's take a look at the demo.
Step 1: Explanation of the principle (the picture is ugly and the principle is true)
1. Draw an external circle. Use a custom color to draw a circle, which is 5 DP longer than the image's radius.
2. After the cust
is a current rendering descriptive narrative table. If it exists, then use wglmakecurrent (NULL, NULL) to remove it. The RC can then be removed via Wgldelete-context. It is safe to agree to delete the DC as a class. Note: Generally, a single-threaded program is used. The resulting RC is the current RC of the thread, and there is no need to focus on this. But assume that you are using a multithreaded program. Then we need to pay special attention to this point. Otherwise, there will be unintende
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.