replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - Graphics - loss of colour
forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Graphics - loss of colour
Goto page Previous  1, 2
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
Catherine



Joined: 16 May 2014
Posts: 16

PostPosted: Fri Jan 23, 2015 6:18 pm    Post subject: Reply with quote

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
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2402
Location: Yateley, Hants, UK

PostPosted: Fri Jan 23, 2015 11:01 pm    Post subject: Reply with quote

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
View user's profile Send private message
Catherine



Joined: 16 May 2014
Posts: 16

PostPosted: Mon Jan 26, 2015 11:22 am    Post subject: Reply with quote

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
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2402
Location: Yateley, Hants, UK

PostPosted: Mon Jan 26, 2015 7:46 pm    Post subject: Reply with quote

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
View user's profile Send private message
Catherine



Joined: 16 May 2014
Posts: 16

PostPosted: Tue Jan 27, 2015 10:29 am    Post subject: Reply with quote

Thanks Eddie.

I will amend the line to

I = WINIO@('%pv%^gr[black,rgb_colours,user_resize]&',IWIDTH,IHIGHT,RESIZE)
Back to top
View user's profile Send private message
Catherine



Joined: 16 May 2014
Posts: 16

PostPosted: Tue Jan 27, 2015 11:28 am    Post subject: Reply with quote

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
View user's profile Send private message
Catherine



Joined: 16 May 2014
Posts: 16

PostPosted: Tue Jan 27, 2015 11:49 am    Post subject: Reply with quote

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
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2402
Location: Yateley, Hants, UK

PostPosted: Tue Jan 27, 2015 1:29 pm    Post subject: Reply with quote

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
View user's profile Send private message
Catherine



Joined: 16 May 2014
Posts: 16

PostPosted: Tue Jan 27, 2015 1:52 pm    Post subject: Reply with quote

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
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2402
Location: Yateley, Hants, UK

PostPosted: Tue Jan 27, 2015 2:19 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
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