Have screen 256x192. And use AutoStretch to resize screen X2 or X3.
But seems very smooth, not pixel perfect.
Is it possible to do some kind of trick for Windows so that the picture is not blurred?

Code: Select all
InitSprite()
InitKeyboard()
ww=100
wh=100
sw=ww
sh=wh
win=OpenWindow(#PB_Any, 50,100, ww,wh, "", #PB_Window_ScreenCentered | #PB_Window_SystemMenu | #PB_Window_SizeGadget)
OpenWindowedScreen(WindowID(win), 0,0, sw,sh, 1,0,0)
spr = CreateSprite(#PB_Any, 50,50, #PB_Sprite_AlphaBlending)
StartDrawing(SpriteOutput(spr))
DrawingMode(#PB_2DDrawing_Outlined | #PB_2DDrawing_AllChannels)
For i=0 To OutputWidth() Step 2
For k=0 To OutputWidth() Step 2
Box(i,k,1,1, $ff00ff00)
Next
Next
StopDrawing()
Repeat
ExamineKeyboard()
Repeat
event = WindowEvent()
Select event
Case #PB_Event_CloseWindow
quit = #True
EndSelect
Until Not event
StartDrawing(ScreenOutput())
DrawingMode(#PB_2DDrawing_Outlined | #PB_2DDrawing_AllChannels)
For i=0 To OutputWidth() Step 2
For k=0 To OutputWidth() Step 2
Box(i,k,1,1, $ff00ff00)
Next
Next
StopDrawing()
DisplaySprite(spr, 0,0)
FlipBuffers()
ClearScreen($333333)
Until quit Or KeyboardPushed(#PB_Key_Escape)
Interesting, I also though it will blur sprite on scale anyway.#NULL wrote: ...I just tried it. To my surprise drawing on the Screen directly interpolates smoothly, whereas displaying a Sprite interpolates pixelsharp. I never realized that![]()
Code: Select all
InitSprite()
ww=256
wh=192
sw=ww
sh=wh
win=OpenWindow(#PB_Any, 50,100, ww,wh, "", #PB_Window_ScreenCentered | #PB_Window_SystemMenu | #PB_Window_SizeGadget)
OpenWindowedScreen(WindowID(win), 0,0, sw,sh, 1,0,0)
spr = CreateSprite(#PB_Any, 256,192, #PB_Sprite_AlphaBlending)
StartDrawing(SpriteOutput(spr))
DrawingMode(#PB_2DDrawing_Outlined | #PB_2DDrawing_AllChannels)
For i=0 To ww-1
For k=0 To wh-1
Plot(i, k, RGBA(Random(255), Random(255), Random(255), 255))
Next
Next
StopDrawing()
Repeat
Repeat
event = WindowEvent()
Select event
Case #PB_Event_CloseWindow
quit = #True
EndSelect
Until Not event
ClearScreen($333333)
DisplaySprite(spr, 0,0)
FlipBuffers()
Until quit