⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmscaling.vb

📁 Microsoft Mobile Development Handbook的代码,有C#,VB,C++的
💻 VB
字号:
Imports Microsoft.VisualBasic
Imports System
Imports System.Windows.Forms
Imports System.Drawing

Namespace CodeForChapter2
  Public Partial Class frmScaling
	  Inherits Form
	Public Sub New()
	  InitializeComponent()
	End Sub

	' run this project on both VGA and non-VGA devices
	Private Sub frmScaling_Paint(ByVal sender As Object, ByVal e As PaintEventArgs) Handles MyBase.Paint
	  Dim left As Integer = 5, right As Integer = 5, width As Integer = 200, height As Integer = 200

	  Dim r As Rectangle = New Rectangle(CInt(Fix(left * Program.ScaleFactor)), CInt(Fix(right * Program.ScaleFactor)), CInt(Fix(width * Program.ScaleFactor)), CInt(Fix(height * Program.ScaleFactor)))

	  Dim thickness As Single = 2
	  Dim p As Pen = New Pen(Color.Red, thickness * Program.ScaleFactor)

	  e.Graphics.DrawEllipse(p, r)

	  Dim b As Brush = New SolidBrush(Color.Blue)
	  Dim x As Single = 75, y As Single = 100
	  e.Graphics.DrawString("scales well", Me.Font, b, x * Program.ScaleFactor, y * Program.ScaleFactor)

	  p.Dispose()
	  b.Dispose()
	End Sub
  End Class
End Namespace

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -