Simple as usual using native commands
Form any image in any shape tech.
Code: Select all
UseTGAImageDecoder()
UseGIFImageDecoder()
UseJPEG2000ImageDecoder()
UseJPEGImageDecoder()
UsePNGImageDecoder()
UseTIFFImageDecoder()
Global fimg
Procedure Rotate(img,ww,hh,Deg)
fimg = CreateImage(#PB_Any,ww*Cos(Radian(deg)) + hh*Sin(Radian(deg)),hh*Cos(Radian(deg))+ ww*Sin(Radian(deg)),32)
StartVectorDrawing(ImageVectorOutput(fimg))
VectorSourceColor($FFFFFFFF)
FillVectorOutput()
ResetCoordinates()
MovePathCursor(hh*Sin(Radian(deg)),0)
RotateCoordinates(ww*Sin(Radian(deg)),0,deg)
DrawVectorImage(ImageID(img), 255)
StopVectorDrawing()
ProcedureReturn fimg
EndProcedure
OpenWindow(0, 0, 0, 800, 600, "Screen", #PB_Window_SystemMenu|#PB_Window_ScreenCentered)
CanvasGadget(0,10,10,780,550)
ContainerGadget(3,10,570,120,20)
SpinGadget(1,0,0,40,20,2,10,#PB_Spin_Numeric)
SetGadgetState(1,2)
ButtonGadget(2,50,0,60,20,"RUN")
CloseGadgetList()
Repeat
Select WaitWindowEvent(1)
Case #PB_Event_CloseWindow
End
Case #PB_Event_Gadget
Select EventGadget()
Case 2
FileName$ = OpenFileRequester("SELECT IMAGE","","All supported formats|*.bmp;*.gif;*.jpg;*.jpeg;*.png;*.tif;*.tiff;*.tga|TGA image (*.tga)|*.tga|TIF image (*.tif)|*.tif|TIFF image (*.tiff)|*.tiff|PNG image (*.png)|*.png|BMP image (*.bmp)|*.bmp|JPEG image (*.jpg;*.jpeg)|*.jpg;*.jpeg|GIF image (*.gif)|*.gif",0)
If FileName$
LoadImage(0,FileName$)
width = ImageWidth(0)
height = ImageHeight(0)
Rotate(0,width,height,35)
width = ImageWidth(fimg)
height = ImageHeight(fimg)
ResizeWindow(0,0,0,width+20,height+50)
HideWindow(0,0,#PB_Window_ScreenCentered)
ResizeGadget(0,10,10,width,height)
ResizeGadget(3,10,height+20,120,20)
dif = GetGadgetState(1)
dif2 = dif/2
CreateImage(1,width,height,32,$FFFFFF)
StartDrawing(ImageOutput(1))
For h = 0 To height-1
GrabImage(fimg,2,0,h,width,1)
DrawingMode(#PB_2DDrawing_AlphaBlend)
DrawImage(ImageID(2),h/dif,h,width-h/dif2,1)
Next
StopDrawing()
SetGadgetAttribute(0,#PB_Canvas_Image ,ImageID(1))
EndIf
EndSelect
EndSelect
ForEver