The title say it all
# 1: Line
Code: Select all
OpenWindow(0, 0, 0, 640,640, "Image DC", #PB_Window_SystemMenu |#PB_Window_ScreenCentered)
LoadImage(1, #PB_Compiler_Home + "Examples\Sources\Data\Background.bmp")
ResizeImage(1,640,640)
color = $0000FF
stroke = 20
x1 = 10 : y1 = 30 : x2 = 500 : y2 = 500
x3 = x1 + stroke : y3 = y1 - stroke :x4 = x2+ stroke : y4 = y2 - stroke
StartDrawing(ImageOutput(1))
LineXY(x1,y1,x2,y2,color)
LineXY(x3,y3,x4,y4,color)
LineXY(x1,y1,x3,y3,color)
LineXY(x2,y2,x4,y4,color)
FillArea(x1+1,y1,color,color)
StopDrawing()
ImageGadget(2, 0, 0,640,640, ImageID(1))
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Quit = 1
EndSelect
Until Quit = 1
Code: Select all
OpenWindow(0, 0, 0, 640,640, "Image DC", #PB_Window_SystemMenu |#PB_Window_ScreenCentered)
LoadImage(1, #PB_Compiler_Home + "Examples\Sources\Data\Background.bmp")
ResizeImage(1,640,640)
color = $0000FF
stroke = 20
x1 = 100 : y1 = 200 : w1 = 400 : h1 = 200
x2 = x1 + stroke : y2 = y1 + stroke :w2 = w1 - 2*stroke : h2 = h1 - 2*stroke
StartDrawing(ImageOutput(1))
DrawingMode(#PB_2DDrawing_Outlined )
RoundBox(x1,y1,w1,h1,20,20,color)
RoundBox(x2,y2,w2,h2,20,20,color)
FillArea(x2-1,y2+h2/2,color,color)
StopDrawing()
ImageGadget(2, 0, 0,640,640, ImageID(1))
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Quit = 1
EndSelect
Until Quit = 1
Code: Select all
OpenWindow(0, 0, 0, 640,640, "Image DC", #PB_Window_SystemMenu |#PB_Window_ScreenCentered)
LoadImage(1, #PB_Compiler_Home + "Examples\Sources\Data\Background.bmp")
ResizeImage(1,640,640)
color = $0000FF
cx = 320 : cy = 320: r = 200
stroke = 40
x = cx - r + stroke/2
y = cy
StartDrawing(ImageOutput(1))
DrawingMode(#PB_2DDrawing_Outlined )
Circle(cx,cy,r,color)
Circle(cx,cy,r-stroke,color)
FillArea(x,y,color,color)
StopDrawing()
ImageGadget(2, 0, 0,640,640, ImageID(1))
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Quit = 1
EndSelect
Until Quit = 1
Have fun