Falls man mal schnell ein Raster zum Anzeigen / Drucken braucht :
Code
Declare Handle static
Window 800, 400
static = Create("Static", %HWnd, 10, 10, 750, 300)
RasterBild(static, RGB(255, 200, 0), 3)
SinusKurve(static)
Waitkey
PROC Rasterbild
Parameters statbild&, farbe%, Raster%
Declare pic&, b%
Select Raster%
CaseOf 1 : b% = 4
CaseOf 2 : b% = 8
CaseOf 3 : b% = 12
CaseOf 4 : b% = 16
CaseOf 5 : b% = 20
CaseOf 6 : b% = 24
CaseOf 7 : b% = 28
CaseOf 8 : b% = 32
CaseOf 9 : b% = 36
CaseOf 10 : b% = 40
CaseOf 11 : b% = 44
CaseOf 12 : b% = 48
CaseOf 13 : b% = 52
CaseOf 14 : b% = 56
CaseOf 15 : b% = 60
CaseOf 16 : b% = 64
CaseOf 17 : b% = 68
CaseOf 18 : b% = 72
CaseOf 19 : b% = 76
CaseOf 20 : b% = 80
OtherWise
b% = 8
EndSelect
MCLS Width(statbild&), Height(statbild&), farbe%
StartPaint - 1
Whileloop Width(statbild&) / b%
UsePen 0, 1, RGB(28, 28, 28)
Line &LOOP * b%, 0 - &LOOP * b%, Height(statbild&)
Line 0, &LOOP * b% - Width(statbild&), &LOOP * b%
EndWhile
EndPaint
pic& = Create("hPic", 0, "&MEMBMP")
StartPaint statbild&
DrawPic pic&, 0, 0; 0
EndPaint
DeleteObject pic&
ENDPROC
Proc Sinuskurve
Parameters st&
Declare x%, y%
StartPaint st&
WhileLoop 0, Width(st&)
x% = &LOOP
y% = 150 + 40 * Sin(x% * .05)
SetPixel x%, y%, Rgb(0, 0, 255)
Endwhile
EndPaint
EndProc
End
Alles anzeigen