[Win x64] v6.02 / v6.03b9 - Image resize issue
Posted: Tue Sep 26, 2023 7:47 pm
ResizeImage() on 24 bit images are ignoring the #PB_Image_Smooth flag.
Oddly though, if you uncomment the 'Drawingfont()' line, the ResizeImage() behaves as expected.
Oddly though, if you uncomment the 'Drawingfont()' line, the ResizeImage() behaves as expected.
Code: Select all
;- example to demonstrate potential bug with ResizeImage().
EnableExplicit
Procedure ExampleImage(img,w,h,txt.s, bits)
CreateImage(img,w,h,bits)
StartDrawing(ImageOutput(img))
Box(0,0,OutputWidth(),OutputHeight(),#White)
DrawingMode(#PB_2DDrawing_Transparent)
Circle(w/2,h/2,h*0.45,255)
;DrawingFont(FontID(0))
DrawText(2,40,Txt,#Black,#White)
DrawText(2,60,"("+Str(bits)+" bit)",#Black,#White)
StopDrawing()
EndProcedure
OpenWindow(0,0,0,640*2,960,"Image resizing test",#PB_Window_ScreenCentered|#PB_Window_SystemMenu|#PB_Window_MinimizeGadget)
LoadFont(0,"Arial",8)
ExampleImage(0,160,120,"Smooth",24) : ResizeImage(0,640,480,#PB_Image_Smooth)
ExampleImage(1,160,120,"Smooth",32) : ResizeImage(1,640,480,#PB_Image_Smooth)
ExampleImage(2,160,120,"Resize during draw",24)
ExampleImage(3,160,120,"Resize during draw",32)
CanvasGadget(0,0,0,640*3,960)
StartDrawing(CanvasOutput(0))
DrawImage(ImageID(0),0,0)
DrawImage(ImageID(1),640,0)
DrawImage(ImageID(2),0,480,640,480)
DrawImage(ImageID(3),640,480,640,480)
StopDrawing()
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow