Page 1 of 1

[Done] 540ß10 Circle and Resize Image

Posted: Thu Oct 22, 2015 7:36 am
by Michael Vogel
Startet now with 5.40 and saw some differences in graphic routines, so circles seems to be larger now, at least in the following code where they touch the image border...
...and smooth resizing is not that fine anymore as some darker pixels are seen in the result.

Here's the code:

Code: Select all


Macro CreateTransparentImage(image,x,y)

	CompilerIf #PB_Compiler_Version<512
		CreateImage(image,x,y,32|#PB_Image_Transparent)
	CompilerElse
		CreateImage(image,x,y,32,#PB_Image_Transparent)
	CompilerEndIf

EndMacro

#WinFnC=51
#ColorCursorLight=$c0c0c0
#DrawOpaque=$ff000000

OpenWindow(0,0,0,600,200,"Resize Test")
For i=1 To 3
	CreateTransparentImage(i,#WinFnC<<1,#WinFnC<<1)
	StartDrawing(ImageOutput(i))
	DrawingMode(#PB_2DDrawing_AlphaBlend)
	Circle(#WinFnC,#WinFnC,#WinFnC-1,#DrawOpaque|#ColorCursorLight)
	StopDrawing()
	Select i
	Case 1
		ResizeImage(i,#WinFnC,#WinFnC)
	Case 2
		ResizeImage(i,#WinFnC,#WinFnC,#PB_Image_Raw)
	EndSelect
	x=(i-1)*200
	ImageGadget(i,x,0,200,200,ImageID(i))
Next i

Repeat
Until WaitWindowEvent()=#PB_Event_CloseWindow
PS: a workaround for the resizing issue is adding DrawingMode(#PB_2DDrawing_AllChannels) and Box(0,0,#WinFnC<<1,#WinFnC<<1,#ColorCursorLight)

Re: [Done] 540ß10 Circle and Resize Image

Posted: Mon Sep 01, 2025 8:07 pm
by Fred
Fixed.