Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
custom Pixel color problem
#1
hi, ive been wondering how to create custom pixel colors using mixtures of red, green blue.

atm im using this code:

Code:
'Main
DECLARE SUB Setpal (index%, blue%, green%, red%)
DECLARE SUB GetPal (index%, blue%, green%, red%)

SCREEN 9

CALL Setpal(1, 47, 47, 63)

PSET (0, 0), 1


'GetPal

SUB GetPal (index%, blue%, green%, red%)
    OUT &H3C7, index%
    blue% = INP(&H3C9)
    green% = INP(&H3C9)
    red% = INP(&H3C9)
END SUB


'SetPal

SUB Setpal (index%, red%, green%, blue%)
    OUT &H3C8, index%
    OUT &H3C9, blue%
    OUT &H3C9, green%
    OUT &H3C9, red%
END SUB

I would like to create an image using PSET or similar method, with custom color pixels, and then save it with GET statement.

However the problem occurs when setting the color to a new mixture of red, green, blue values, the pixels with color 1 are also changed to the new color, and thus the image produced is all the same color. this is basically the same as the palette statement, when the value is changed, all pixels on the screen change to that new color.

so what i was wondering, is it possible to use the same color value, eg. 1 to create different mixtures of red green blue, put them on the screen, but stop the program from changing the colors already on the screen, when the new mixture of red green blue is made.

or is there any other method of drawing custom color pixels composed of red green blue values to the screen?

thank you all for any help.
Reply
#2
No. When they say 16 colors at a time, they mean 16 colors at a time. Now, there are certainly better modes at your disposal. Screen 13 has 256 colors at your disposal, and with the use of a library such as UGL, you can very easily access a high or true color VESA mode which will let you have a unique rgb for each pixel.
i]"I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kinda lost track myself. But being as this is a .44 Magnum ... you've got to ask yourself one question: 'Do I feel lucky?' Well, do ya punk?"[/i] - Dirty Harry
Reply
#3
^ That means you can have 65536(in 16bit mode) or 16.7million colors(24/32bit mode).

I would suggest using Future.Lib instead of UGL. Future.Lib is more compatible =).

But you should know that once you use these libraries none of the older QB commands will work.

If you want to see how one of these libs works and what you need to learn them then you can have a look at my tut about future.lib here =)
Reply
#4
what a shame. looks like ive got even more research to do.. ahha,
i think i might try sumthing different then.

thankx for your help. =)
Reply
#5
Whatever you feel. But the only option you've got is using Future.Lib/UGL or anyother high rez library.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)