В мою программу (на VB

GSerg писал(а):Подскажем...
GetDIBits сотоварищи...
DefInt A-Z ' Default variable type is integer
Sub Mandelbrot()
' Set maximum number of iterations per point:
Const MAXLOOP = 30, MAXSIZE = 1000000
' Loop through each pixel in viewport and calculate
' whether or not it is in the Mandelbrot Set:
For Y = 0 To ScaleHeight ' Loop through every line in
' the viewport.
PSet (0, LogicY) ' Plot leftmost pixel in the line.
OldColor = 0 ' Start with background color.
For X = 0 To ScaleWidth ' Loop through every pixel in
' the line.
MandelX& = X
MandelY& = Y
' Do the calculations to see if this point is in
' the Mandelbrot Set:
For I = 1 To MAXLOOP
RealNum& = MandelX& * MandelX&
ImagNum& = MandelY& * MandelY&
If (RealNum& + ImagNum&) >= MAXSIZE Then Exit For
MandelY& = (MandelX& * MandelY&) \ 250 + Y
MandelX& = (RealNum& - ImagNum&) \ 500 + X
Next I
' Assign a color to the point:
PColor = I Mod 16
' If color has changed, draw a line from the
' last point referenced to the new point,
' using the old color:
If PColor <> OldColor Then
Line -(X, Y), QBColor(OldColor)
OldColor = PColor
End If
Next X
' Draw the last line segment to the right edge of
' the viewport:
Line -(X, Y), QBColor(OldColor)
Next Y
End Sub
Private Sub Form_Load()
ScaleMode = vbPixels
AutoRedraw = True
WindowState = vbMaximized
Show
Mandelbrot
End Sub
Сейчас этот форум просматривают: Google-бот и гости: 16