|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
Kenneth_Smith
Joined: 18 May 2012 Posts: 697 Location: Hamilton, Lanarkshire, Scotland.
|
Posted: Sun Nov 12, 2017 6:19 pm Post subject: %gr[smooth4] or %gt[smooth8] not working |
|
|
The following code runs fine. However if the smooth4 or smooth8 option for the %gr are used, parts of the drawing are not show. I am using the latest release of the compiler.
Code: | program main
implicit none
integer view_graphics_cb
integer i
i = view_graphics_cb()
end program main
integer function view_graphics_cb()
implicit none
include<windows.ins>
integer i
integer, parameter :: gw = 400, gh = 400
i = winio@('%gr&',gw,gh)
!$$$$$$ i = winio@('%gr[smooth4]&',gw,gh) !Use one of these instead of the line above
!$$$$$$ i = winio@('%gr[smooth8]&',gw,gh)
call SET_LINE_WIDTH@(1)
call SET_LINE_STYLE@(PS_SOLID)
call draw_ellipse@(gw/2, gh/2 + 0, 20, 20, rgb@(0,0,0))
call draw_ellipse@(gw/2, gh/2 + 20, 20, 20, rgb@(0,0,0))
call draw_filled_rectangle@(gw/2 - 50, 60, gw/2 + 50, 70, rgb@(0,0,0))
call draw_filled_rectangle@(gw/2 - 50, gh-60, gw/2 + 50, gh-70, rgb@(0,0,0))
call draw_line_between@(gw/2, 60, gw/2, gh/2-20, rgb@(0,0,0))
call draw_line_between@(gw/2, gh-60, gw/2, gh/2+40, rgb@(0,0,0))
i = winio@(' ')
view_graphics_cb = 1
end function view_graphics_cb |
|
|
Back to top |
|
|
Kenneth_Smith
Joined: 18 May 2012 Posts: 697 Location: Hamilton, Lanarkshire, Scotland.
|
Posted: Sun Nov 12, 2017 7:46 pm Post subject: |
|
|
A better example, looks like a coordinate problem to me. Both the calls to draw_filled_rectangle@ define the same rectangle (I think ! - it's been a long day).
Code: |
integer function view_graphics_cb()
include<windows.ins>
integer i
integer, parameter :: gw = 400, gh = 400
i = winio@('%gr[smooth4]&',gw,gh)
call SET_LINE_WIDTH@(1)
call draw_rectangle@(150, 60, 250, 70, rgb@(0,0,0))
! call draw_filled_rectangle@(150, 340, 250, 330, rgb@(0,0,0)) !#### This does not work with [smooth4]
call draw_filled_rectangle@(150, 330, 250, 340, rgb@(0,0,0)) !#### This does work with [smooth4]
i = winio@(' ')
view_graphics_cb = 1
end function view_graphics_cb |
draw_rectangle@ has the same issue.
Ken |
|
Back to top |
|
|
John-Silver
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
Posted: Sun Nov 12, 2017 9:45 pm Post subject: |
|
|
I'm puzzled with the 2nd example Ken.
Are you saying changing the dimensions of he rectangle makes it work/not work ? |
|
Back to top |
|
|
Kenneth_Smith
Joined: 18 May 2012 Posts: 697 Location: Hamilton, Lanarkshire, Scotland.
|
Posted: Sun Nov 12, 2017 10:57 pm Post subject: |
|
|
John, it's the order in which the coordinates are entered.
One line defines Bottom Left and Top Right corners, whilst the other defines Top Left and Bottom Right. In only one case is the solid rectangle drawn:-
Both work without the smooth4 option. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7928 Location: Salford, UK
|
Posted: Mon Nov 13, 2017 8:16 am Post subject: |
|
|
Ah yes. This can be fixed but for the moment it is necessary to draw from the top left to the bottom right otherwise the width and/or height turns out to be negative. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7928 Location: Salford, UK
|
Posted: Mon Nov 13, 2017 9:39 am Post subject: |
|
|
This has now been fixed for the next release of the ClearWin+ library. |
|
Back to top |
|
|
Kenneth_Smith
Joined: 18 May 2012 Posts: 697 Location: Hamilton, Lanarkshire, Scotland.
|
Posted: Mon Nov 13, 2017 2:17 pm Post subject: |
|
|
Thanks Paul, it took me longer to understand what was going wrong than it did for you to fix! Ken |
|
Back to top |
|
|
John-Silver
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
Posted: Tue Nov 14, 2017 8:44 pm Post subject: |
|
|
This post has inspired me ....
What's the difference between Paul Laidler and Paul Weller ?
1. Paul Weller is a forgotten mod while Paul Laidler forgot the mod
2. Paul Laidler is a Bug-to-fix Collector while Paul Weller is a Butterfly Collector
ok I'll get me coat
... gosh what a contorted, contrived excuse to post some good music:-)
Enjoy ....
https://www.youtube.com/watch?v=KObNG4B_yuo |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|