 |
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
Catherine
Joined: 16 May 2014 Posts: 16
|
Posted: Fri Jan 23, 2015 6:18 pm Post subject: |
|
|
The only mention I can find in he code of anything that looks like %gr, %og or %gw is the following statement:
I = WINIO@('%pv%^gr[black,user_resize]&',IWIDTH,IHIGHT,RESIZE) |
|
Back to top |
|
 |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2402 Location: Yateley, Hants, UK
|
Posted: Fri Jan 23, 2015 11:01 pm Post subject: |
|
|
Catherine,
Clutching at straws:
I'm puzzled by your %gr, as with user_resize and the ^ qualifier you need a callback function, and I could see that was the integer function RESIZE, but then where is the user_supplied graphics handle?
Here's the equivalent from one of my programs (predating the RGB colours default)
Code: | IA=WINIO@('%pv%^`gr[white,rgb_colours,user_resize'//
& ']'//
& '&',IXRES,IYRES,IHDC, GR_callback_FN) |
(apologies for the first continuation). Of course, it may simply be the case that you typed it incompletely, or it may be that a graphics handle wasn't required and now it is.
Eddie |
|
Back to top |
|
 |
Catherine
Joined: 16 May 2014 Posts: 16
|
Posted: Mon Jan 26, 2015 11:22 am Post subject: |
|
|
I was just about to try a modification in line with that suggesred above. However, before doing this. I re-linked one of my programss and I am back to glorious techniclour! A second program likewise.
I have had no clour for almost 6 months. During that timeI have continued to modify, compile. link and run the codes almost daily. (None of my changes have involved the graphics routines which have been unchanged for many years). This morning things have returned to normal as suddenly as they went wrong. It must be because it is my birthday. |
|
Back to top |
|
 |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2402 Location: Yateley, Hants, UK
|
Posted: Mon Jan 26, 2015 7:46 pm Post subject: |
|
|
Many Happy Returns, Catherine, but the fact remains that you need an extra parameter to the format code, so maybe it will work, maybe it won't, as it is.
Eddie |
|
Back to top |
|
 |
Catherine
Joined: 16 May 2014 Posts: 16
|
Posted: Tue Jan 27, 2015 10:29 am Post subject: |
|
|
Thanks Eddie.
I will amend the line to
I = WINIO@('%pv%^gr[black,rgb_colours,user_resize]&',IWIDTH,IHIGHT,RESIZE) |
|
Back to top |
|
 |
Catherine
Joined: 16 May 2014 Posts: 16
|
Posted: Tue Jan 27, 2015 11:28 am Post subject: |
|
|
I added rgb_colours to the statement as above. The graphs all went back to blue on black - the previous 'no colour' problem.
I took rgb_colours out again and the colour returned.
So, not quite sorted yet ... |
|
Back to top |
|
 |
Catherine
Joined: 16 May 2014 Posts: 16
|
Posted: Tue Jan 27, 2015 11:49 am Post subject: |
|
|
I have replaced rgb_colours by vga_colurs and have the colours back again.
I Do you think this may be the solution? |
|
Back to top |
|
 |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2402 Location: Yateley, Hants, UK
|
Posted: Tue Jan 27, 2015 1:29 pm Post subject: |
|
|
Catherine,
You have probably hit it on the head. John_Silver suggested this, and I dismissed it because I thought that you'd tried it.
But you still haven't got the user-supplied handle for your graphics area, which goes between the callback and the sizes.
Paul may wish to comment that the user-supplied handle is optional if you only have one graphics area, but I certainly didn't get that from reading the documentation, although I would have thought there would be a runtime error. You certainly will struggle without a handle (even if Clearwin+ lets you get away with it) if you want to have more than one %gr.
Eddie |
|
Back to top |
|
 |
Catherine
Joined: 16 May 2014 Posts: 16
|
Posted: Tue Jan 27, 2015 1:52 pm Post subject: |
|
|
Eddie,
That is where I have put the vga_colurs, following your advice.
I now have
I = WINIO@('%pv%^gr[black,vga_colours,user_resize]&
& ',IWIDTH,IHIGHT,RESIZE)
So I first tried rgb_colours, as you suggested. When this didn't work I changed it to vga_colours.
Catherine. |
|
Back to top |
|
 |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2402 Location: Yateley, Hants, UK
|
Posted: Tue Jan 27, 2015 2:19 pm Post subject: |
|
|
Catherine, taking your code, I think it should look like this:
Code: |
iHANDLE = 99
I = WINIO@('%pv%^gr[black,vga_colours,user_resize]&
& ',IWIDTH,IHIGHT,iHANDLE,RESIZE) |
The point of iHANDLE (which can take any integer value you care to give it) is that you can have multiple %gr objects, including several on different windows and printer objects, and you can switch between them using, for example:
Code: | i=SELECT_GRAPHICS_OBJECT@ (99) |
would select the object defined above.
On another matter, as your graphic is made up of lines, you must be using the line drawing routines such as
SUBROUTINE DRAW_LINE_BETWEEN@(IX1,IY1,IX2,IY2,ICOL)
and what has been going wrong for you is that your ICOL values which were OK for VGA_COLOURS have not been OK for RGB_COLOURS. It's just a guess, but your colour values are perhaps named colours such as BLUE, RED etc? In which case if you wanted to use RGB_COLOURS then you would need to master the RGB@ function where you give the 3 colour indices Red, Green and Blue each in the range 0..255. I bet that some of your colour values in VGA mode were effectively invisible or wrong in RGB mode.
Eddie |
|
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
|