Home > Software engineering >  programming
programming

Time:11-12

Valentine's day to programming a surprise for my girlfriend, please help

CodePudding user response:

Baidu many

CodePudding user response:

https://download.csdn.net/download/sysdzw/3958137? Utm_source=bbsseo good luck

CodePudding user response:

With code at least draw a heart like?
Send you a, heart function of VB,

 
Option Explicit


Private Sub Form_Click ()
Me. The ScaleMode=3
Const size=80 'size constant, his
Dim As Double, I j As Double
For I=0 To Me. The ScaleWidth
For j=0 To Me ScaleHeight
If ((I - Me. ScaleWidth/2)/size) ^ 2 + ((- j + Me ScaleHeight/2)/size - ((I - Me. ScaleWidth/2)/size) ^ 2 ^ 0.3) ^ 2-1 & lt;=0.1 Then Me. PSet (I, j), vbRed
Next
Next
End Sub






CodePudding user response:

Enhanced, match colors is very ugly, curtilage home pure play, useful take go to, show off in an ostentatious manner mathematics with him,

Heart function formula: x ^ 2 + (y - x ^ (2/3))=1 but with a pixel drawn in form coordinate system, and rotating what thing to do the corresponding function deformation

 
Option Explicit


Private Sub Form_Click ()
Me. The ScaleMode=3
Const size=80 'size constant, his
Dim As Double, I j As Double
For I=0 To Me. The ScaleWidth
For j=0 To Me ScaleHeight
If (I & lt; Me. ScaleWidth/2 + 20 And I & gt; Me. ScaleWidth * 1/5 And Abs (j + 30 - Me ScaleHeight/2) & lt; 3) Then Me. PSet (I, j), vbRed
If ((I - Me. ScaleWidth/2)/size) ^ 2 + ((- j + Me ScaleHeight/2)/size - ((I - Me. ScaleWidth/2)/size) ^ 2 ^ 0.3) ^ 2-1 & lt;=0.1 Then Me. PSet (I, j), vbRed
If ((I - Me. ScaleWidth/2-20)/size) ^ 2 + ((- j + Me ScaleHeight/2)/size - ((I - Me. ScaleWidth/2-20)/size) ^ 2 ^ 0.3) ^ 2-1 & lt;=0.1 Then Me. PSet (I, j), vbBlue
If (I & gt; Me. ScaleWidth/2 + 20 And I & lt; Me. ScaleWidth * 4/5 And Abs (j + 30 - Me ScaleHeight/2) & lt; 3) Then Me. PSet (I, j), vbRed
If ((j - Me ScaleHeight/2 + 30)/(size/10)) ^ 2 + ((+ Me. -i ScaleWidth/2 + Me. ScaleWidth * 0.3)/(size/10) - ((j - Me ScaleHeight/2 + 30)/(size/10)) ^ 2 ^ 0.3) ^ 2-1 & lt;=0.1 Then Me. PSet (I, j), vbRed
If ((j - Me ScaleHeight/2 + 30)/(size/10)) ^ 2 + ((+ Me. -i ScaleWidth/2 - Me. ScaleWidth * 0.3)/(size/10) - ((j - Me ScaleHeight/2 + 30)/(size/10)) ^ 2 ^ 0.3) ^ 2-1 & lt;=0.1 Then Me. PSet (I, j), vbRed
If ((j - Me ScaleHeight/2 + 30)/(size/10)) ^ 2 + ((+ Me. -i ScaleWidth/2 - Me. ScaleWidth * 0.29)/(size/10) - ((j - Me ScaleHeight/2 + 30)/(size/10)) ^ 2 ^ 0.3) ^ 2-1 & lt;=0.1 Then Me. PSet (I, j), vbRed
If ((j - Me ScaleHeight/2 + 30)/(size/10)) ^ 2 + ((+ Me. -i ScaleWidth/2 - Me. ScaleWidth * 0.28)/(size/10) - ((j - Me ScaleHeight/2 + 30)/(size/10)) ^ 2 ^ 0.3) ^ 2-1 & lt;=0.1 Then Me. PSet (I, j), vbRed
If ((j - Me ScaleHeight/2 + 30)/(size/10)) ^ 2 + ((+ Me. -i ScaleWidth/2 - Me. ScaleWidth * 0.27)/(size/10) - ((j - Me ScaleHeight/2 + 30)/(size/10)) ^ 2 ^ 0.3) ^ 2-1 & lt;=0.1 Then Me. PSet (I, j), vbRed
If ((j - Me ScaleHeight/2 + 30)/(size/10)) ^ 2 + ((+ Me. -i ScaleWidth/2 - Me. ScaleWidth * 0.26)/(size/10) - ((j - Me ScaleHeight/2 + 30)/(size/10)) ^ 2 ^ 0.3) ^ 2-1 & lt;=0.1 Then Me. PSet (I, j), vbRed
Next
Next
End Sub


CodePudding user response:

Suggest you join a Flash player plugin online next you happy love Flash files and then forms play!

CodePudding user response:

Wow, you are very efficient and unified reply, thank you bosses