Page 1 of 1
Posted: Fri Jan 03, 2003 7:40 pm
by BackupUser
Restored from previous forum. Originally posted by BigSnake.
It would be nice if you could set a Viewport and all drawing commands will work only within the borders of this viewport.
I´ve the problem, that i must cut a text at the edge of a box,
Posted: Fri Jan 03, 2003 8:16 pm
by BackupUser
Restored from previous forum. Originally posted by WolfgangS.
Hi !
you can create an Image with CreateImage(#Image, Breite, Höhe). Then plot your stuff into the Image and plot the image into your screen.
MFG
WolfgangS
Posted: Fri Jan 03, 2003 8:50 pm
by BackupUser
Restored from previous forum. Originally posted by tinman.
Here is something that might be useful until PB gets its own command for clipping graphic areas.
Code: Select all
If OpenWindow(0, 0, 0, 400, 300, #PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget|#PB_Window_SizeGadget|#PB_Window_TitleBar, "foo")
Repeat
ev.l = WaitWindowEvent()
Select ev
Case #PB_Event_Repaint
hdc.l = StartDrawing(WindowOutput())
rgn.l = CreateRectRgn_(50, 50, 101, 101) ; Try to create cliiping rectangle
If rgn ; Make sure it was successful
SelectClipRgn_(hdc, rgn) ; Install it into the device context
Box(0, 0, 200, 200, RGB(255, 0, 0)) ; Draw something to prove it clips
SelectClipRgn_(hdc, 0) ; Remove clipping
DeleteObject_(rgn) ; And free the region we created
EndIf
StopDrawing()
EndSelect
Until ev=#PB_Event_CloseWindow
EndIf
End
PS, this is not perfect. For example, it does not check to see if PB has already installed a clipping area before freeing it (ideally it would go back to the one PB installs). However, I couldn't figure out how to do it.
--
It's not minimalist - I'm increasing efficiency by reducing input effort.
(Win98first ed. + SP1, PB3.40)