vb点虐 菱形 vb编程菱形
有关vb点虐 里的hatchbrush
Imports System.Drawing.Drawing2D
创新互联公司专业为企业提供溧阳网站建设、溧阳做网站、溧阳网站设计、溧阳网站制作等企业网站建设、网页设计与制作、溧阳企业网站模板建站服务,十多年溧阳做网站经验,不只是建网站,更提供有价值的思路和整体网络服务。
Public Class Form1
Private Sub Form1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Click
'定义一个 Graphics对象
'调用窗体的CreateGraphics 方法创建 Graphics 对象
Dim g As Graphics
g = Me.CreateGraphics
'创建用实心菱形图案进行绘制,并使用红色作为前景色,蓝色作为背景色的画笔
Dim aHatchBrush As HatchBrush = New HatchBrush(HatchStyle.SolidDiamond, Color.Red, Color.Blue)
'创建矩形的位置和大小
Dim x As Integer = 0
Dim y As Integer = 0
Dim width As Integer = 150
Dim height As Integer = 200
'调用图形方法FillRectangle 将定义的矩形绘制到创建Graphics 对象上
g.FillRectangle(aHatchBrush, x, y, width, height)
End Sub
End Class
vb点虐 中输出空心菱形
这是C#的
Console.WriteLine("请输入一个数?");
//这里假设只能输入数字
int number = Convert.ToInt32(Console.ReadLine()) / 2 + 1;
for (int i = 1; i = number; i++)
{
Console.Write(new string(' ', number - i));
Console.WriteLine(new string('*', i * 2 - 1));
}
for (int i = number - 1; i = 1; i--)
{
Console.Write(new string(' ', number - i));
Console.WriteLine(new string('*', i * 2 - 1));
}
vb点虐 ,dim rects as rectangle()()={a,b,c,d,e,f} 我忘了双小括号的
Dim a As New System.Drawing.Rectangle(2,1,20,40)
Dim b As New System.Drawing.Rectangle(4,4,40,30)
Dim c As New System.Drawing.Rectangle(6,7,60,20)
Dim d As New System.Drawing.Rectangle(8,10,80,10)
Dim rectabcd = {a, b, c, d} ''数组(a、b、c、d)
Public Sub 调用组()
rectabcd.GetValue(2) ''获取rectabcd{c}返回值 Object。
……ListRect.Item(2).Height
rectabcd.ToList.Item(0) ''获取或设置rectabcd.ToList[a]的值。
End Sub
Public ListRect As List(Of Drawing.Rectangle) = {New Rectangle(0, 0, 10, 10), New Rectangle(10, 1, 20, 20)}.ToList ''ListRect共2个Rectangle。
VB点虐 为什么取消了“lenb”“midb”这些函数,点虐 又如何通过变通方法来实现?
include QtCore/QCoreApplication
#include QAxObject
#include Windows.h
int main(int argc, char *argv[])
{
//OleInitialize(0);
//CoInitialize(0);
QCoreApplication a(argc, argv);
QAxObject *asdfg = new QAxObject("Excel.Application");
return a.exec();
}
本文题目:vb点虐 菱形 vb编程菱形
文章分享:http://pwwzsj.com/article/ddgsejg.html