Post by funkheld on Jun 7, 2016 12:12:56 GMT 1
Here are a programs in gfa32 and asm with graphic.
weiter:
weiter:
weiter:
greeting
INIT
Do : Sleep : Until Me Is Nothing
Sub INIT
Global Int w, h, z, z1, z2
Global Int art, Hbm
Global BIH As BitmapInfoHeader
Global Int ZDC, ZAd 'Handle, Anfangsadresse des Ziel-DC
w = 200
h = 200
z1 = w * h * 4
Form F0 = "asm-test" , , , 600, 400 : .BackColor = $C0C0C0
Ocx Form Ziel = , 20, 10, w, h : .Appearance = 0 : .AutoRedraw = 1
Ocx Command C(1) = "asm", 20, 260, 60, 20
Ocx Command C(2) = "cls", 20, 280, 60, 20
Type BitmapInfoHeader
- Int biSize, biWidth, biHeight
- Short biPlanes, biBitCount
- Int biCompression, biSizeImage, biXPelsPerMeter, biYPelsPerMeter, biClrUsed, biClrImportant
End Type
BIH.biSize = SizeOf(BIH)
BIH.biPlanes = 1
BIH.biBitCount = 32
ZDC = CreateCompatibleDC(F0.hDC) : BIH.biWidth = w : BIH.biHeight = h
Hbm = CreateDIBSection(Null, *BIH, DIB_RGB_COLORS, *ZAd, Null, 0)
~SelectObject(ZDC, Hbm) : FreeBmp Hbm
cls_asm
Sub C_Click(Idx%)
art = Idx
Select art
Case 1 : gdi_lineto : gdi_rectangle : gdi_ellipse
Case 2 : cls_asm
EndSelect
Sub gdi_lineto
$StepOff
. push 10
. push 50
. push ZDC
. scall MoveToEx
. push 40
. push 150
. push ZDC
. scall LineTo
BitBlt ZDC, 0, 0, w, h, Ziel.hDC
Sub gdi_rectangle
$StepOff
. push 10
. push 10
. push 150
. push 80
. push ZDC
. scall Rectangle
BitBlt ZDC, 0, 0, w, h, Ziel.hDC
Sub gdi_ellipse
$StepOff
. push 50
. push 60
. push 120
. push 180
. push ZDC
. scall Ellipse
BitBlt ZDC, 0, 0, w, h, Ziel.hDC
Sub cls_asm
$StepOff
. push esi, edi
. mov ecx, [ZAd]
. mov eax, [z1]
.M1:
. mov [ ecx], $ffffff
. sub eax, 4
. add ecx, 4
. test eax, eax
. jnz .M1
BitBlt ZDC, 0, 0, w, h, Ziel.hDC
weiter:
INIT
Do : Sleep : Until Me Is Nothing
Sub INIT
Global Int w, h, z, z1, z2, p_inhalt
Global Int art, Hbm, hpen
Global BIH As BitmapInfoHeader
Global Int ZDC, ZAd
Type POINTAPI
- Int x, y
End Type
Global AP(7) As POINTAPI
AP(0).x = 20
AP(0).y = 50
AP(1).x = 180
AP(1).y = 50
AP(2).x = 180
AP(2).y = 20
AP(3).x = 230
AP(3).y = 70
AP(4).x = 180
AP(4).y = 120
AP(5).x = 180
AP(5).y = 90
AP(6).x = 20
AP(6).y = 90
AP(7).x = 20
AP(7).y = 90
w = 400
h = 400
z1 = w * h * 4
Form F0 = "asm-test" , , , 600, 600 : .BackColor = $C0C0C0
Ocx Form Ziel = , 20, 10, w, h : .Appearance = 0 : .AutoRedraw = 1
Ocx Command C(1) = "asm", 20, 440, 60, 20
Ocx Command C(2) = "cls", 20, 460, 60, 20
Type BitmapInfoHeader
- Int biSize, biWidth, biHeight
- Short biPlanes, biBitCount
- Int biCompression, biSizeImage, biXPelsPerMeter, biYPelsPerMeter, biClrUsed, biClrImportant
End Type
BIH.biSize = SizeOf(BIH)
BIH.biPlanes = 1
BIH.biBitCount = 32
ZDC = CreateCompatibleDC(F0.hDC) : BIH.biWidth = w : BIH.biHeight = h
Hbm = CreateDIBSection(Null, *BIH, DIB_RGB_COLORS, *ZAd, Null, 0)
~SelectObject(ZDC, Hbm) : FreeBmp Hbm
hpen = CreatePen(0, 4, RGB(0, 255, 0))
p_inhalt = V:AP(0)
cls_asm
Sub C_Click(Idx%)
art = Idx
Select art
Case 1 : gdi_polygon
Case 2 : cls_asm
EndSelect
Sub gdi_polygon
$StepOff
. push esi, edi
. push hpen
. push ZDC
. scall SelectObject
. push 90
. push 20
. push ZDC
. scall MoveToEx
. push 8
. push p_inhalt
. push ZDC
. scall PolylineTo
BitBlt ZDC, 0, 0, w, h, Ziel.hDC
Sub cls_asm
$StepOff
. push esi, edi
. mov ecx, [ZAd]
. mov eax, [z1]
.M1:
. mov [ ecx], $ffffff
. sub eax, 4
. add ecx, 4
. test eax, eax
. jnz .M1
BitBlt ZDC, 0, 0, w, h, Ziel.hDC
weiter:
INIT
Do : Sleep : Until Me Is Nothing
Sub INIT
Global Int w, h, z, z1, z2, p_inhalt
Global Int art, Hbm, hpen
Global BIH As BitmapInfoHeader
Global Int ZDC, ZAd
Type POINTAPI
- Int x, y
End Type
Global AP(7) As POINTAPI
AP(0).x = 20
AP(0).y = 50
AP(1).x = 180
AP(1).y = 50
AP(2).x = 180
AP(2).y = 20
AP(3).x = 230
AP(3).y = 70
AP(4).x = 180
AP(4).y = 120
AP(5).x = 180
AP(5).y = 90
AP(6).x = 20
AP(6).y = 90
AP(7).x = 20
AP(7).y = 90
w = 400
h = 400
z1 = w * h * 4
Form F0 = "asm-test" , , , 600, 600 : .BackColor = $C0C0C0
Ocx Form Ziel = , 20, 10, w, h : .Appearance = 0 : .AutoRedraw = 1
Ocx Command C(1) = "asm", 20, 440, 60, 20
Ocx Command C(2) = "cls", 20, 460, 60, 20
Type BitmapInfoHeader
- Int biSize, biWidth, biHeight
- Short biPlanes, biBitCount
- Int biCompression, biSizeImage, biXPelsPerMeter, biYPelsPerMeter, biClrUsed, biClrImportant
End Type
BIH.biSize = SizeOf(BIH)
BIH.biPlanes = 1
BIH.biBitCount = 32
ZDC = CreateCompatibleDC(F0.hDC) : BIH.biWidth = w : BIH.biHeight = h
Hbm = CreateDIBSection(Null, *BIH, DIB_RGB_COLORS, *ZAd, Null, 0)
~SelectObject(ZDC, Hbm) : FreeBmp Hbm
p_inhalt = V:AP(0)
cls_asm
Sub C_Click(Idx%)
art = Idx
Select art
Case 1 : gdi_polygon
Case 2 : cls_asm
EndSelect
Sub gdi_polygon
$StepOff
. push esi, edi
. push $ff0000
. push 1
. push 3
. scall CreatePen
. push eax
. push ZDC
. scall SelectObject
. push 90
. push 20
. push ZDC
. scall MoveToEx
. push 8
. push p_inhalt
. push ZDC
. scall PolylineTo
BitBlt ZDC, 0, 0, w, h, Ziel.hDC
Sub cls_asm
$StepOff
. push esi, edi
. mov ecx, [ZAd]
. mov eax, [z1]
.M1:
. mov [ ecx], $ffffff
. sub eax, 4
. add ecx, 4
. test eax, eax
. jnz .M1
BitBlt ZDC, 0, 0, w, h, Ziel.hDC
weiter:
INIT
Do : Sleep : Until Me Is Nothing
Sub INIT
Global Int w, h, z, z1, z2
Global Int art, Hbm
Global BIH As BitmapInfoHeader
Global Int ZDC, ZAd 'Handle, Anfangsadresse des Ziel-DC
w = 200
h = 200
z1 = w * h * 4
Form F0 = "asm-test" , , , 600, 400 : .BackColor = $C0C0C0
Ocx Form Ziel = , 20, 10, w, h : .Appearance = 0 : .AutoRedraw = 1
Ocx Command C(1) = "asm", 20, 260, 60, 20
Ocx Command C(2) = "cls", 20, 280, 60, 20
Type BitmapInfoHeader
- Int biSize, biWidth, biHeight
- Short biPlanes, biBitCount
- Int biCompression, biSizeImage, biXPelsPerMeter, biYPelsPerMeter, biClrUsed, biClrImportant
End Type
BIH.biSize = SizeOf(BIH)
BIH.biPlanes = 1
BIH.biBitCount = 32
ZDC = CreateCompatibleDC(F0.hDC) : BIH.biWidth = w : BIH.biHeight = h
Hbm = CreateDIBSection(Null, *BIH, DIB_RGB_COLORS, *ZAd, Null, 0)
~SelectObject(ZDC, Hbm) : FreeBmp Hbm
cls_asm
Sub C_Click(Idx%)
art = Idx
Select art
Case 1 : z2 = z1 / 2 : setze_punkt_asm
Case 2 : cls_asm
EndSelect
Sub setze_punkt_asm
$StepOff
. push esi, edi
. mov ecx, [ZAd]
. mov eax, [z2]
.M1:
. mov [ ecx], $ff0000
. sub eax, 4
. add ecx, 4
. test eax, eax
. jnz .M1
BitBlt ZDC, 0, 0, w, h, Ziel.hDC
Sub cls_asm
$StepOff
. push esi, edi
. mov ecx, [ZAd]
. mov eax, [z1]
.M1:
. mov [ ecx], $ffffff
. sub eax, 4
. add ecx, 4
. test eax, eax
. jnz .M1
BitBlt ZDC, 0, 0, w, h, Ziel.hDC
greeting