peter
24-02-2014, 20:12
Hello,
Gdiplus on Canvas, is that possible?
I have made a small attempt and got a success.
The question is whether this runs with Windows8, Window7 has no problems.
Gdiplus is an ancient Gdi and will not updated anymore. Nevertheless, it has a mighty Graphics on board.
At the moment, I have only some primitives, to play with it.
Examples:
Uses "ui"
#INCLUDE "gdip.inc"
OpenWindow 640, 480
Long x, y, i
SetSmoothMode 2
While IsWindow(hwnd) And GetAsyncKeyState(27)=0
ClsColor &HFF000000
DrawBox 50,50,100,100,1,&HFFFFFF00
FillBox 50, 180,100,100, &HFFFFFF00
FillBox 100,220,100,100, &H6400FF00
FillBox 140,260,100,100, &H64FF0000
DrawLine 0,170,639,170,2, &HFFFF0000
DrawEllipse 200,100,60,60,2,&HFF00FFFF
FillEllipse 280,100,60,60, &HFFD49696
For i=100 To 360
DrawPoint i,400,1,ARGB 200,255,255,255
Canvas_SetPixel i,410,&HFFFFFF
Next
Canvas_Redraw
Sleep 10
Wend
ShutDown
Canvas_Window End hwnd
Uses "ui"
#INCLUDE "gdip.inc"
OpenWindow 640, 480
Long col,sx,sy,anz,speed,xscreen,yscreen,i,sx,sy,co
xscreen=640 : yscreen=480 : speed=8 : anz=2000
Dim xstern(anz) As Long
Dim ystern(anz) As Long
Dim zstern(anz) As Long
For i=1 To anz
xstern(i) = Rnd(-(xscreen/2), (xscreen/2))*255
ystern(i) = Rnd(-(yscreen/2), (yscreen/2))*255
zstern(i) = Rnd( speed,255 )
Next
SetSmoothMode 2
While IsWindow(hwnd) And GetAsyncKeyState(27)=0
ClsColor &HFF000000
For i=1 To anz
zstern(i) = zstern(i) - speed
If zstern(i) <= speed Then zstern(i) = 255
sx = (xstern(i) / zstern(i)) + (xscreen/2)
sy = (ystern(i) / zstern(i)) + (yscreen/2)
co = (300 - zstern(i))
DrawPoint sx, sy, 4, ARGB 255,co,co,co
Next
Canvas_Redraw
Sleep 10
Wend
ShutDown
Canvas_Window End
Gdiplus on Canvas, is that possible?
I have made a small attempt and got a success.
The question is whether this runs with Windows8, Window7 has no problems.
Gdiplus is an ancient Gdi and will not updated anymore. Nevertheless, it has a mighty Graphics on board.
At the moment, I have only some primitives, to play with it.
Examples:
Uses "ui"
#INCLUDE "gdip.inc"
OpenWindow 640, 480
Long x, y, i
SetSmoothMode 2
While IsWindow(hwnd) And GetAsyncKeyState(27)=0
ClsColor &HFF000000
DrawBox 50,50,100,100,1,&HFFFFFF00
FillBox 50, 180,100,100, &HFFFFFF00
FillBox 100,220,100,100, &H6400FF00
FillBox 140,260,100,100, &H64FF0000
DrawLine 0,170,639,170,2, &HFFFF0000
DrawEllipse 200,100,60,60,2,&HFF00FFFF
FillEllipse 280,100,60,60, &HFFD49696
For i=100 To 360
DrawPoint i,400,1,ARGB 200,255,255,255
Canvas_SetPixel i,410,&HFFFFFF
Next
Canvas_Redraw
Sleep 10
Wend
ShutDown
Canvas_Window End hwnd
Uses "ui"
#INCLUDE "gdip.inc"
OpenWindow 640, 480
Long col,sx,sy,anz,speed,xscreen,yscreen,i,sx,sy,co
xscreen=640 : yscreen=480 : speed=8 : anz=2000
Dim xstern(anz) As Long
Dim ystern(anz) As Long
Dim zstern(anz) As Long
For i=1 To anz
xstern(i) = Rnd(-(xscreen/2), (xscreen/2))*255
ystern(i) = Rnd(-(yscreen/2), (yscreen/2))*255
zstern(i) = Rnd( speed,255 )
Next
SetSmoothMode 2
While IsWindow(hwnd) And GetAsyncKeyState(27)=0
ClsColor &HFF000000
For i=1 To anz
zstern(i) = zstern(i) - speed
If zstern(i) <= speed Then zstern(i) = 255
sx = (xstern(i) / zstern(i)) + (xscreen/2)
sy = (ystern(i) / zstern(i)) + (yscreen/2)
co = (300 - zstern(i))
DrawPoint sx, sy, 4, ARGB 255,co,co,co
Next
Canvas_Redraw
Sleep 10
Wend
ShutDown
Canvas_Window End