在屏幕上画简单图形和显示图片、处理简单鼠标键盘事件

/***************************************************************
* Name: MyApp.h
* Purpose: Defines Application Class
* Author: PingGe (414236069@qq.com)
* Created: 2013-10-14
* Copyright: PingGe (http://www.cnblogs.com/pingge/)
* License:
**************************************************************/ #ifndef WXTESTAPP_H
#define WXTESTAPP_H #include <wx/app.h> class MyApp : public wxApp //应用程序类,应用程序的入口点
{
public:
virtual bool OnInit(void); //在应用程序启动时调用,如果返回false,退出应用程序
}; #endif // WXTESTAPP_H
/***************************************************************
* Name: MyApp.cpp
* Purpose: Code for Application Class
* Author: PingGe (414236069@qq.com)
* Created: 2013-10-14
* Copyright: PingGe (http://www.cnblogs.com/pingge/)
* License:
**************************************************************/ #include <wx/wx.h>
//(*AppHeaders
#include "MyApp.h"
#include "MyFrame.h"
//*) DECLARE_APP(MyApp);
IMPLEMENT_APP(MyApp); bool MyApp::OnInit(void)
{
MyFrame * frame = new MyFrame(NULL, wxT("wxWidgets")); //为新窗口分配空间,设定标题 frame->Show(); return wxOK;
}
/***************************************************************
* Name: MyFrame.h
* Purpose: Defines Application Frame
* Author: PingGe (414236069@qq.com)
* Created: 2013-10-14
* Copyright: PingGe (http://www.cnblogs.com/pingge/)
* License:
**************************************************************/ #ifndef WXTESTMAIN_H
#define WXTESTMAIN_H #include <wx/frame.h> class MyFrame : public wxFrame //窗体类
{
public:
//Constructor
MyFrame(wxWindow * parent, const wxString & title); //窗体的构造函数
//Destructor
~MyFrame() {}; //Event handlers
void OnAbout (wxCommandEvent & event);
void OnQuit (wxCommandEvent & event);
void OnMotion (wxMouseEvent & event);
void OnPaint (wxPaintEvent & event);
void OnMousePrc (wxMouseEvent & event);
void OnKeyPrc (wxKeyEvent & event); private:
DECLARE_EVENT_TABLE();
}; #endif // WXTESTMAIN_H
/***************************************************************
* Name: MyFrame.cpp
* Purpose: Code for Application Frame
* Author: PingGe (414236069@qq.com)
* Created: 2013-10-14
* Copyright: PingGe (http://www.cnblogs.com/pingge/)
* License:
**************************************************************/ #include <wx/wx.h>
#include <wx/dcbuffer.h>
//(*FrameHeaders
#include "MyApp.h"
#include "MyFrame.h"
#include "wxPingGe.h"
//*) //事件表:(类,基类)
BEGIN_EVENT_TABLE(MyFrame,wxFrame)
//(*EventTable(MyFrame)
EVT_MENU (wxID_ABOUT, MyFrame::OnAbout) //把wxID_ABOUT和OnAbout关联
EVT_MENU (wxID_EXIT, MyFrame::OnQuit) //把wxID_EXIT和OnQuit关联
EVT_MOTION ( MyFrame::OnMotion) //鼠标事件
EVT_PAINT ( MyFrame::OnPaint) //刷屏消息
EVT_MOUSE_EVENTS( MyFrame::OnMousePrc) //鼠标事件
EVT_KEY_DOWN ( MyFrame::OnKeyPrc) //键盘事件
//*)
END_EVENT_TABLE() #include "wx.xpm"
MyFrame::MyFrame(wxWindow * parent, const wxString & title)
: wxFrame(NULL, wxID_ANY, title)
{
SetIcon(wxIcon(wx_xpm)); wxMenu * fileMenu = new wxMenu; //建立“文件”菜单
wxMenu * helpMenu = new wxMenu; //建立“帮助”菜单 //增加菜单项(标识、文本、帮助字符)
helpMenu->Append(wxID_ABOUT, wxT("&About...\tF2"), wxT("Show about dialog"));
fileMenu->Append(wxID_EXIT, wxT("&Exit...\tAlt-X"), wxT("Quit this programe")); wxMenuBar * menuBar = new wxMenuBar(); //建立一个菜单条
menuBar->Append(fileMenu, wxT("&File")); //将"文件"菜单加入到菜单条
menuBar->Append(helpMenu, wxT("&Help")); //将“帮助”菜单加入到菜单条 SetMenuBar(menuBar); //将菜单条放到窗体上 CreateStatusBar(); //创建两个状态栏,并写上字符串
SetStatusText(wxT("welcome to wxWidgets!"), );
} void MyFrame::OnAbout(wxCommandEvent & event)
{
wxString msg;
msg.Printf(wxT("hello and welcome to %s"), wxVERSION_STRING); //消息的字符串 //消息框:(消息内容、标题、窗口类型、父窗口)
wxMessageBox(msg, wxT("About Minimal"), wxOK | wxICON_INFORMATION, this);
} void MyFrame::OnQuit(wxCommandEvent & event)
{
Close();
} void MyFrame::OnMotion(wxMouseEvent & event)
{
if(event.Dragging()) //鼠标拖动时为真
{
wxClientDC dc(this); //创建一个指向当前窗口的设备指针dc
wxPen pen(*wxRED, ); //创建画笔,颜色:红色,宽度:1
dc.SetPen(pen);
dc.DrawPoint(event.GetPosition()); //画点
dc.SetPen(wxNullPen);
}
} void MyFrame::OnPaint(wxPaintEvent & event) //刷屏消息处理函数
{
wxBufferedPaintDC mydc(this);
mydc.SetPen(*wxWHITE_PEN); //mydc.SetBrush(*wxRED_BRUSH);
mydc.SetBrush(wxColor(, , )/*wxRED_BRUSH*/); mydc.SetBackground(wxBrush(*wxWHITE, wxSOLID)); wxSize sz = GetClientSize(); //获取窗口大小 wxCoord w = , h = ; //要绘制的矩形大小 int x = wxMax(, sz.x / ) - w / ; //将矩形放置在窗口的正中间,但不为负
int y = wxMax(, sz.y / ) - h / ; wxRect rectToDraw(x, y, w, h); if(IsExposed(rectToDraw)) //只有在需要的时候才重新画以便提高效率
{
//mydc.DrawRectangle(rectToDraw); //画矩形 //DrawTextString(mydc, wxT("test"), wxPoint(50, 50)); //画字符串 //DrawRotatedTest(mydc, wxT("PingGe"), wxPoint(100, 100), 60); //旋转字符串 DrawSimpleShape(mydc); DrawMap(mydc);
}
/*
窗口最大化后出现两个矩形,原因是窗口变大时原先部分没有刷新,
只把新增部分刷新出来;
*/
} void MyFrame::OnMousePrc(wxMouseEvent & event)
{
wxPoint pt(event.GetPosition()); //获取当前坐标pt wxClientDC dc(this); //设置一个设备上下文 if((pt.x > ) && (pt.y > ) && (event.LeftDown()))
{
wxPen pen(*wxWHITE, ); //白色画笔
dc.SetPen(pen);
dc.DrawLine(, , , ); //当鼠标左键点击位置在(100, 100)之后时用白色画笔画线
}
if(event.LeftUp())
{
wxPen pen(*wxRED, ); //红色画笔
dc.SetPen(pen);
dc.DrawLine(, , , ); //当鼠标左键弹起时,用红色画笔画线
}
} void MyFrame::OnKeyPrc(wxKeyEvent & event) //处理按键按下的消息
{
wxClientDC dc(this); //设置一个设备上下文 wxPen pen(*wxWHITE, );
dc.SetPen(pen); //白色画笔 if(event.ShiftDown()) //按下shift键画一条直线
{
dc.DrawLine(, , , );
} int code = event.GetKeyCode(); //获取按下按键的编码
if(code == )
{
dc.DrawLine(, , , ); //当按下A键时画一条直线
}
}
/***************************************************************
* Name: wxPingGe.h
* Purpose: Code for Application Frame
* Author: PingGe (414236069@qq.com)
* Created: 2013-10-14
* Copyright: PingGe (http://www.cnblogs.com/pingge/)
* License:
**************************************************************/
#ifndef _WXPINGGE_H_
#define _WXPINGGE_H_ #include <wx/wx.h>
#include <wx/dcbuffer.h> //画字符函数:(DC,文本,位置)
void DrawTextString(wxDC & dc, const wxString & text, const wxPoint & pt); //画旋转字符函数:(DC,文本,位置,旋转角度)
void DrawRotatedTest(wxDC & dc, const wxString & text, const wxPoint & pt, int angle = ); //画一些图形
void DrawSimpleShape(wxDC & dc); //画图片
void DrawMap(wxDC & dc); #endif //_WXPINGGE_H_
/***************************************************************
* Name: wxPingGe.cpp
* Purpose: Code for Application Frame
* Author: PingGe (414236069@qq.com)
* Created: 2013-10-14
* Copyright: PingGe (http://www.cnblogs.com/pingge/)
* License:
**************************************************************/ #include "wxPingGe.h" void DrawTextString(wxDC & dc, const wxString & text, const wxPoint & pt)
{
//定义一个wxFont类的对象font
//构造函数wxFont::wxFont(字体大小、字体类型(书法、艺术)、斜体)
wxFont font(, wxFONTFAMILY_SCRIPT, wxNORMAL, wxBOLD); //利用DC类的成员函数SetFont设置字体
dc.SetFont(font); //设置背景透或者不透
dc.SetBackgroundMode(wxSOLID/*wxTRANSPARENT*/); //设置前景颜色
dc.SetTextForeground(*wxRED); //设置背景颜色
dc.SetTextBackground(*wxWHITE); //写字,文本wxString,位置wxPoint
dc.DrawText(text, pt);
} void DrawRotatedTest(wxDC & dc, const wxString & text, const wxPoint & pt, int angle)
{
wxFont font(, wxFONTFAMILY_SCRIPT, wxNORMAL, wxBOLD); dc.SetFont(font); dc.SetBackgroundMode(wxTRANSPARENT/*wxSOLID*/); dc.SetTextForeground(*wxWHITE); dc.SetTextBackground(*wxRED); dc.DrawRotatedText(text, pt, angle);
} void DrawSimpleShape(wxDC & dc)
{
//设置画笔画刷
dc.SetPen(wxPen(*wxRED, , wxSOLID)); dc.SetBrush(wxBrush(*wxGREEN, wxSOLID)); //画抛物线
dc.DrawSpline(, , , , , ); //画点
dc.DrawPoint(, ); //画线:(注意,最后一个点不会画)
dc.DrawLine(, , , ); //画矩形:(用画笔画边框,画刷填充内部)
dc.DrawRectangle(, , , ); //设置画刷为红色
dc.SetBrush(*wxRED_BRUSH); //画圆角矩形
dc.DrawRoundedRectangle(, , , , ); //设置颜色
dc.SetBrush(wxColor(, , )); //画圆
dc.DrawCircle(, , );
} #include "1.xpm"
void DrawMap(wxDC & dc)
{
wxBitmap bitmap(logo_xpm);
dc.DrawBitmap(bitmap, , , wxBITMAP_TYPE_XPM); dc.SetTextBackground(*wxBLACK);
dc.SetTextForeground(*wxWHITE); wxString msg = wxT("Some text is mixed in bmp shade."); for(int i = , step = ; i < ; i++, step += )
{
dc.DrawText(msg, , step);
}
}

在屏幕上画普通文字和旋转的文字

/***************************************************************
* Name: MyApp.h
* Purpose: Defines Application Class
* Author: PingGe (414236069@qq.com)
* Created: 2013-10-14
* Copyright: PingGe (http://www.cnblogs.com/pingge/)
* License:
**************************************************************/ #ifndef WXTESTAPP_H
#define WXTESTAPP_H #include <wx/app.h> class MyApp : public wxApp //应用程序类,应用程序的入口点
{
public:
virtual bool OnInit(void); //在应用程序启动时调用,如果返回false,退出应用程序
}; #endif // WXTESTAPP_H
/***************************************************************
* Name: MyApp.cpp
* Purpose: Code for Application Class
* Author: PingGe (414236069@qq.com)
* Created: 2013-10-14
* Copyright: PingGe (http://www.cnblogs.com/pingge/)
* License:
**************************************************************/ #include <wx/wx.h>
//(*AppHeaders
#include "MyApp.h"
#include "MyFrame.h"
//*) DECLARE_APP(MyApp);
IMPLEMENT_APP(MyApp); bool MyApp::OnInit(void)
{
MyFrame * frame = new MyFrame(NULL, wxT("wxWidgets")); //为新窗口分配空间,设定标题 frame->Show(); return wxOK;
}
/***************************************************************
* Name: MyFrame.h
* Purpose: Defines Application Frame
* Author: PingGe (414236069@qq.com)
* Created: 2013-10-14
* Copyright: PingGe (http://www.cnblogs.com/pingge/)
* License:
**************************************************************/ #ifndef WXTESTMAIN_H
#define WXTESTMAIN_H #include <wx/frame.h> class MyFrame : public wxFrame //窗体类
{
public:
//Constructor
MyFrame(wxWindow * parent, const wxString & title); //窗体的构造函数
//Destructor
~MyFrame() {}; //Event handlers
void OnAbout (wxCommandEvent & event);
void OnQuit (wxCommandEvent & event);
void OnMotion (wxMouseEvent & event);
void OnPaint (wxPaintEvent & event); private:
DECLARE_EVENT_TABLE();
}; #endif // WXTESTMAIN_H
/***************************************************************
* Name: MyFrame.cpp
* Purpose: Code for Application Frame
* Author: PingGe (414236069@qq.com)
* Created: 2013-10-14
* Copyright: PingGe (http://www.cnblogs.com/pingge/)
* License:
**************************************************************/ #include <wx/wx.h>
#include <wx/dcbuffer.h>
//(*FrameHeaders
#include "MyApp.h"
#include "MyFrame.h"
#include "wxPingGe.h"
//*) //事件表:(类,基类)
BEGIN_EVENT_TABLE(MyFrame,wxFrame)
//(*EventTable(MyFrame)
EVT_MENU (wxID_ABOUT, MyFrame::OnAbout)
EVT_MENU (wxID_EXIT, MyFrame::OnQuit)
EVT_MOTION ( MyFrame::OnMotion)
EVT_PAINT ( MyFrame::OnPaint)
//*)
END_EVENT_TABLE() #include "wx.xpm"
MyFrame::MyFrame(wxWindow * parent, const wxString & title)
: wxFrame(NULL, wxID_ANY, title)
{
SetIcon(wxIcon(wx_xpm)); wxMenu * fileMenu = new wxMenu; //建立“文件”菜单
wxMenu * helpMenu = new wxMenu; //建立“帮助”菜单 //增加菜单项(标识、文本、帮助字符)
helpMenu->Append(wxID_ABOUT, wxT("&About...\tF2"), wxT("Show about dialog"));
fileMenu->Append(wxID_EXIT, wxT("&Exit...\tAlt-X"), wxT("Quit this programe")); wxMenuBar * menuBar = new wxMenuBar(); //建立一个菜单条
menuBar->Append(fileMenu, wxT("&File")); //将"文件"菜单加入到菜单条
menuBar->Append(helpMenu, wxT("&Help")); //将“帮助”菜单加入到菜单条 SetMenuBar(menuBar); //将菜单条放到窗体上 CreateStatusBar(); //创建两个状态栏,并写上字符串
SetStatusText(wxT("welcome to wxWidgets!"));
} void MyFrame::OnAbout(wxCommandEvent & event)
{
wxString msg;
msg.Printf(wxT("hello and welcome to %s"), wxVERSION_STRING); //消息的字符串 //消息框:(消息内容、标题、窗口类型、父窗口)
wxMessageBox(msg, wxT("About Minimal"), wxOK | wxICON_INFORMATION, this);
} void MyFrame::OnQuit(wxCommandEvent & event)
{
Close();
} void MyFrame::OnMotion(wxMouseEvent & event)
{
if(event.Dragging()) //鼠标拖动时为真
{
wxClientDC dc(this); //创建一个指向当前窗口的设备指针dc
wxPen pen(*wxRED, ); //创建画笔,颜色:红色,宽度:1
dc.SetPen(pen);
dc.DrawPoint(event.GetPosition()); //画点
dc.SetPen(wxNullPen);
}
} void MyFrame::OnPaint(wxPaintEvent & event) //刷屏消息处理函数
{
wxBufferedPaintDC mydc(this);
mydc.SetPen(*wxBLACK_PEN);
mydc.SetBrush(*wxRED_BRUSH); wxSize sz = GetClientSize(); //获取窗口大小 wxCoord w = , h = ; //要绘制的矩形大小 int x = wxMax(, sz.x / ) - w / ; //将矩形放置在窗口的正中间,但不为负
int y = wxMax(, sz.y / ) - h / ; wxRect rectToDraw(x, y, w, h); if(IsExposed(rectToDraw)) //只有在需要的时候才重新画以便提高效率
{
mydc.DrawRectangle(rectToDraw); DrawTextString(mydc, wxT("test"), wxPoint(, )); //画字符串 DrawRotatedTest(mydc, wxT("PingGe"), wxPoint(, ), ); //旋转字符串
}
/*
窗口最大化后出现两个矩形,原因是窗口变大时原先部分没有刷新,
只把新增部分刷新出来;
*/
}
/***************************************************************
* Name: wxPingGe.h
* Purpose: Code for Application Frame
* Author: PingGe (414236069@qq.com)
* Created: 2013-10-14
* Copyright: PingGe (http://www.cnblogs.com/pingge/)
* License:
**************************************************************/
#ifndef _WXPINGGE_H_
#define _WXPINGGE_H_ #include <wx/wx.h>
#include <wx/dcbuffer.h> //画字符函数:(DC,文本,位置)
void DrawTextString(wxDC & dc, const wxString & text, const wxPoint & pt); //画旋转字符函数:(DC,文本,位置,旋转角度)
void DrawRotatedTest(wxDC & dc, const wxString & text, const wxPoint & pt, int angle = ); #endif //_WXPINGGE_H_
/***************************************************************
* Name: wxPingGe.cpp
* Purpose: Code for Application Frame
* Author: PingGe (414236069@qq.com)
* Created: 2013-10-14
* Copyright: PingGe (http://www.cnblogs.com/pingge/)
* License:
**************************************************************/ #include "wxPingGe.h" void DrawTextString(wxDC & dc, const wxString & text, const wxPoint & pt)
{
//定义一个wxFont类的对象font
//构造函数wxFont::wxFont(字体大小、字体类型(书法、艺术)、斜体)
wxFont font(, wxFONTFAMILY_SCRIPT, wxNORMAL, wxBOLD); //利用DC类的成员函数SetFont设置字体
dc.SetFont(font); //设置背景透或者不透
dc.SetBackgroundMode(wxSOLID/*wxTRANSPARENT*/); //设置前景颜色
dc.SetTextForeground(*wxRED); //设置背景颜色
dc.SetTextBackground(*wxWHITE); //写字,文本wxString,位置wxPoint
dc.DrawText(text, pt);
} void DrawRotatedTest(wxDC & dc, const wxString & text, const wxPoint & pt, int angle)
{
wxFont font(, wxFONTFAMILY_SCRIPT, wxNORMAL, wxBOLD); dc.SetFont(font); dc.SetBackgroundMode(wxTRANSPARENT/*wxSOLID*/); dc.SetTextForeground(*wxWHITE); dc.SetTextBackground(*wxRED); dc.DrawRotatedText(text, pt, angle);
}

在屏幕上画点和矩形

/***************************************************************
* Name: MyApp.h
* Purpose: Defines Application Class
* Author: PingGe (414236069@qq.com)
* Created: 2013-10-14
* Copyright: PingGe (http://www.cnblogs.com/pingge/)
* License:
**************************************************************/ #ifndef WXTESTAPP_H
#define WXTESTAPP_H #include <wx/app.h> class MyApp : public wxApp
{
public:
virtual bool OnInit(void);
}; #endif // WXTESTAPP_H
/***************************************************************
* Name: MyApp.cpp
* Purpose: Code for Application Class
* Author: PingGe (414236069@qq.com)
* Created: 2013-10-14
* Copyright: PingGe (http://www.cnblogs.com/pingge/)
* License:
**************************************************************/ #include "MyApp.h" //(*AppHeaders
#include "wx/wx.h"
#include "MyFrame.h"
//*) DECLARE_APP(MyApp);
IMPLEMENT_APP(MyApp); bool MyApp::OnInit(void)
{
MyFrame * frame = new MyFrame(NULL, wxT("wxWidgets")); //为新窗口分配空间,设定标题 frame->Show(); return wxOK;
}
/***************************************************************
* Name: MyFrame.h
* Purpose: Defines Application Frame
* Author: PingGe (414236069@qq.com)
* Created: 2013-10-14
* Copyright: PingGe (http://www.cnblogs.com/pingge/)
* License:
**************************************************************/ #ifndef WXTESTMAIN_H
#define WXTESTMAIN_H #include <wx/frame.h> class MyFrame : public wxFrame
{
public:
//Constructor
MyFrame(wxWindow * parent, const wxString & title);
//Destructor
~MyFrame() {}; //Event handlers
void OnAbout (wxCommandEvent & event);
void OnQuit (wxCommandEvent & event);
void OnMotion (wxMouseEvent & event);
void OnPaint (wxPaintEvent & event); private:
DECLARE_EVENT_TABLE();
}; #endif // WXTESTMAIN_H
/***************************************************************
* Name: MyFrame.cpp
* Purpose: Code for Application Frame
* Author: PingGe (414236069@qq.com)
* Created: 2013-10-14
* Copyright: PingGe (http://www.cnblogs.com/pingge/)
* License:
**************************************************************/ #include "MyFrame.h" //(*InternalHeaders(wxTestDialog)
#include "wx/wx.h"
#include "wx/dcbuffer.h"
#include "MyApp.h"
//*) BEGIN_EVENT_TABLE(MyFrame,wxFrame)
//(*EventTable(wxTestDialog)
EVT_MENU (wxID_ABOUT, MyFrame::OnAbout)
EVT_MENU (wxID_EXIT, MyFrame::OnQuit)
EVT_MOTION ( MyFrame::OnMotion)
EVT_PAINT ( MyFrame::OnPaint)
//*)
END_EVENT_TABLE() #include "wx.xpm"
MyFrame::MyFrame(wxWindow * parent, const wxString & title)
: wxFrame(NULL, wxID_ANY, title)
{
SetIcon(wxIcon(wx_xpm)); wxMenu * fileMenu = new wxMenu; //定义两个菜单项
wxMenu * helpMenu = new wxMenu; //增加菜单项(标识、文本、帮助字符)
helpMenu->Append(wxID_ABOUT, wxT("&About...\tF2"), wxT("Show about dialog"));
fileMenu->Append(wxID_EXIT, wxT("&Exit...\tAlt-X"), wxT("Quit this programe")); wxMenuBar * menuBar = new wxMenuBar(); //定义菜单条
menuBar->Append(fileMenu, wxT("&File"));
menuBar->Append(helpMenu, wxT("&Help")); SetMenuBar(menuBar); CreateStatusBar(); //创建两个状态栏,并写上字符串
SetStatusText(wxT("welcome to wxWidgets!"));
} void MyFrame::OnAbout(wxCommandEvent & event)
{
wxString msg;
msg.Printf(wxT("hello and welcome to %s"), wxVERSION_STRING); //消息的字符串 //消息框:(消息内容、标题、窗口类型、父窗口)
wxMessageBox(msg, wxT("About Minimal"), wxOK | wxICON_INFORMATION, this);
} void MyFrame::OnQuit(wxCommandEvent & event)
{
Close();
} void MyFrame::OnMotion(wxMouseEvent & event)
{
if(event.Dragging()) //鼠标拖动时为真
{
wxClientDC dc(this); //创建一个指向当前窗口的设备指针dc
wxPen pen(*wxRED, ); //创建画笔,颜色:红色,宽度:1
dc.SetPen(pen);
dc.DrawPoint(event.GetPosition());
dc.SetPen(wxNullPen);
}
} void MyFrame::OnPaint(wxPaintEvent & event)
{
wxBufferedPaintDC mydc(this);
mydc.SetPen(*wxBLACK_PEN);
mydc.SetBrush(*wxRED_BRUSH); wxSize sz = GetClientSize(); //获取窗口大小 wxCoord w = , h = ; //要绘制的矩形大小 int x = wxMax(, sz.x / ) - w / ; //将矩形放置在窗口的正中间,但不为负
int y = wxMax(, sz.y / ) - h / ; wxRect rectToDraw(x, y, w, h); if(IsExposed(rectToDraw)) //只有在需要的时候才重新画以便提高效率
{
mydc.DrawRectangle(rectToDraw);
}
/*
窗口最大化后出现两个矩形,原因是窗口变大时原先部分没有刷新,
只把新增部分刷新出来;
*/
}

wxWidgets学习笔记——在屏幕上画简单的图形和文字的更多相关文章

  1. (转)第02节:在Canvas上画简单的图形

    我们现在已经可以在HTML中使用Fabric.js库了,那这节我们就详细的学习一下如何在canvas上画出简单的图形. 在画东西之前我们需要了解画任何东西的基本三个步骤: 声明画布(canvas),用 ...

  2. unity3d之在屏幕上画线

    如何在屏幕上画线,简单的代码如下: using UnityEngine; public class Test : MonoBehaviour { void OnGUI() { GL.LoadOrtho ...

  3. SpringMVC:学习笔记(8)——文件上传

    SpringMVC--文件上传 说明: 文件上传的途径 文件上传主要有两种方式: 1.使用Apache Commons FileUpload元件. 2.利用Servlet3.0及其更高版本的内置支持. ...

  4. Django:学习笔记(8)——文件上传

    Django:学习笔记(8)——文件上传 文件上传前端处理 本模块使用到的前端Ajax库为Axio,其地址为GitHub官网. 关于文件上传 上传文件就是把客户端的文件发送给服务器端. 在常见情况(不 ...

  5. Flutter学习笔记(14)--StatefulWidget简单使用

    如需转载,请注明出处:Flutter学习笔记(14)--StatefulWidget简单使用 今天上班没那么忙,突然想起来我好像没StatefulWidget(有状态组件)的demo,闲来无事,写一个 ...

  6. 学习笔记:利用GDI+生成简单的验证码图片

    学习笔记:利用GDI+生成简单的验证码图片 /// <summary> /// 单击图片时切换图片 /// </summary> /// <param name=&quo ...

  7. Directx11学习笔记【一】 最简单的windows程序HelloWin

    声明:本系列教程代码有部分来自dx11龙书及dx11游戏编程入门两本书,后面不再说明 首先,在vs2013中创建一个空的解决方案Dx11Demo,以后的工程都会放在这个解决方案下面.然后创建一个win ...

  8. Web安全学习笔记 SQL注入上

    Web安全学习笔记 SQL注入上 繁枝插云欣 --ICML8 SQL注入分类 SQL注入检测 一.注入分类 1.简介 SQL注入是一种代码注入技术用于攻击数据驱动的应用程序在应用程序中,如果没有做恰当 ...

  9. deepin linux学习笔记(四)进不去图形界面怎么办?

    目录 deepin linux学习笔记(四)进不去图形界面怎么办? 前言 更换成lxde桌面 进不去图形界面怎么办? 总结 deepin linux学习笔记(四)进不去图形界面怎么办? 前言 生命不息 ...

随机推荐

  1. leetcode problem 10 Regular Expression Matching(动态规划)

    Implement regular expression matching with support for '.' and '*'. '.' Matches any single character ...

  2. javascript 单行向上滚动文字

    <html><head><meta http-equiv="Content-Type" content="text/html; charse ...

  3. yii2源码学习笔记(十七)

    Theme 类,应用的主题,通过替换路径实现主题的应用,方法为获取根路径和根链接:yii2\base\Theme.php <?php /** * @link http://www.yiifram ...

  4. django查询常用操作符及models和admin的写法

    以Publisher.Author.Book的model为例子 #coding=utf-8 from django.db import models # Create your models here ...

  5. 简单的介绍下WPF中的MVVM框架

    最近在研究学习Swift,苹果希望它迅速取代复杂的Objective-C开发,引发了一大堆热潮去学它,放眼望去各个培训机构都已打着Swift开发0基础快速上手的招牌了.不过我觉得,等同于无C++基础上 ...

  6. githubRepository -- 使用

    1. 注册github账号; 2. 配置SSH keys; 点击setting, 配置 SSH keys Generating SSH keys 检查本地的 SSH keys: a> 在用户目录 ...

  7. Quartz1.8.5例子(十四)

    org.quartz.scheduler.instanceName: PriorityExampleScheduler # Set thread count to 1 to force Trigger ...

  8. 菜鸟Android之路(上)

    自己为什么要学android 本人作为应届毕业生,自己进入社会前做过好多梦,可是呢,现实还是打败了无邪!!面对社会的压力和残酷的竞争力自己如何生成下去??我自己对自己说:第一步 先养活自己,才能走好以 ...

  9. 【技术贴】解决 myeclipse打不开报错an error has occurred, see .

    方法1.右键选中快捷方式属性选项,在快捷方式页,目标一项最后加上-clean选项,如C:\MyEclipse6\eclipse.exe -clean. 然后重新启动一下MyEclipse. 方法2. ...

  10. SaltStack的salt-api里如何指定用户执行cmd.script

    在杨威的协助下,命令行,API调用都完美搞定. 主要是RUNAS参数的位置,以及它作为CURL POST -D DATA的使用. salt '1.2.3.4' cmd.script "sal ...