• Print

Author Topic: _clearcolor not funktion  (Read 485 times)

funkheld

  • Full Member
  • ***
  • Posts: 229
    • Email
_clearcolor not funktion
« on: June 25, 2011, 10:08:15 AM »
Code: [Select]
SCREEN 13
img& = _LOADIMAGE("Qb64logo.png")
_PUTIMAGE , img&, 0              
K$ = INPUT$(1)
CLS , _RGB(255, 0, 0)            
_CLEARCOLOR _RGB(255, 255, 255), img&
_PUTIMAGE , img&, 0              
END  
« Last Edit: June 25, 2011, 10:16:21 AM by funkheld »

Clippy

  • Hero Member
  • *****
  • Posts: 16431
  • I LOVE π = 4 * ATN(1)    Use the QB64 WIKI >>>
    • Pete's Qbasic Site
    • Email
Re: cls and _clearcolor not funktion
« Reply #1 on: June 25, 2011, 10:16:54 AM »
Works for me. Red background where white was. What do you get?
QB64 WIKI: Main Page
Download Q-Basics Code Demo: Q-Basics.zip
Download QB64 BAT, IconAdder and VBS shortcuts: QB64BAT.zip
Download QB64 DLL files in a ZIP: Program64.zip

funkheld

  • Full Member
  • ***
  • Posts: 229
    • Email
Re: _clearcolor not funktion
« Reply #2 on: June 25, 2011, 10:22:23 AM »
this not ok:

_CLEARCOLOR _RGB(255, 255, 255), img&
_PUTIMAGE , img&, 0        

DSMan195276

  • Hero Member
  • *****
  • Posts: 1978
  • Yes
    • Email
Re: _clearcolor not funktion
« Reply #3 on: June 25, 2011, 10:24:27 AM »
I took screen shots of what I got when I ran it:

https://dl.dropbox.com/s/p38aj7y61e4qefw/Before.png

https://dl.dropbox.com/s/905thn1kti7weht/After.png

It's exactly what it should do. Is it doing something different for you? I recommend making sure you have the most recent version of QB64. This test was done on Linux, Ver-.935.

Matt
« Last Edit: June 25, 2011, 11:21:40 AM by DSMan195276 »
"Cast your cares on the Lord and he will sustain you; he will never let the righteous be shaken" -- Psalm 55:22
QB64 Linux Installer

funkheld

  • Full Member
  • ***
  • Posts: 229
    • Email
Re: _clearcolor not funktion
« Reply #4 on: June 25, 2011, 10:36:17 AM »
_CLEARCOLOR _RGB(255, 255, 255), img&  not ok  ??? not white
_CLEARCOLOR _RGB(255, 0, 255), img&  not ok  ???  not ping

Code: [Select]
scr1&=_newimage(500,500,32)
SCREEN scr1&
img& = _newimage(128,128,32)
_CLEARCOLOR _RGB(255, 0, 255), img&
_PUTIMAGE (0,0), img&, scr1&
K$ = INPUT$(1)
CLS , _RGB(255, 0, 0)
_CLEARCOLOR _RGB(255, 255, 255), img&
_PUTIMAGE (0,0), img&,scr1&
END
« Last Edit: June 25, 2011, 10:45:17 AM by funkheld »

Clippy

  • Hero Member
  • *****
  • Posts: 16431
  • I LOVE π = 4 * ATN(1)    Use the QB64 WIKI >>>
    • Pete's Qbasic Site
    • Email
Re: _clearcolor not funktion
« Reply #5 on: June 25, 2011, 10:38:23 AM »
Maybe it doesn't understand German?  ;)
QB64 WIKI: Main Page
Download Q-Basics Code Demo: Q-Basics.zip
Download QB64 BAT, IconAdder and VBS shortcuts: QB64BAT.zip
Download QB64 DLL files in a ZIP: Program64.zip

funkheld

  • Full Member
  • ***
  • Posts: 229
    • Email
Re: _clearcolor not funktion
« Reply #6 on: June 25, 2011, 10:39:03 AM »
yes...

funkheld

  • Full Member
  • ***
  • Posts: 229
    • Email
Re: _clearcolor not funktion
« Reply #7 on: June 25, 2011, 10:40:25 AM »
DSMan195276  : version 0.936 window

gruss
« Last Edit: June 25, 2011, 10:51:37 AM by funkheld »

DSMan195276

  • Hero Member
  • *****
  • Posts: 1978
  • Yes
    • Email
Re: _clearcolor not funktion
« Reply #8 on: June 25, 2011, 11:17:08 AM »
Ah, so you are updated to the most recent version.

Do you understand what _CLEARCOLOR Does Funkheld? When you a command such as _CLEARCOLOR _RGB(255, 255, 255), IMG& all the pixels in img& that match _RGB(255,255,255) will be erased, and made transparent. If you wouldn't mind, I'd suggest you take a screen shot of your program running so we can see the same output that you're seeing.

Matt
"Cast your cares on the Lord and he will sustain you; he will never let the righteous be shaken" -- Psalm 55:22
QB64 Linux Installer

funkheld

  • Full Member
  • ***
  • Posts: 229
    • Email
Re: _clearcolor not funktion
« Reply #9 on: June 25, 2011, 01:06:12 PM »
why is the screen "scr1&" black and not ping ?

Code: [Select]
scr1&=_newimage(500,500,32)
SCREEN scr1&
_CLEARCOLOR _RGB(255, 0, 255), scr1&
END

gruss
« Last Edit: June 25, 2011, 01:11:33 PM by funkheld »

Clippy

  • Hero Member
  • *****
  • Posts: 16431
  • I LOVE π = 4 * ATN(1)    Use the QB64 WIKI >>>
    • Pete's Qbasic Site
    • Email
Re: _clearcolor not funktion
« Reply #10 on: June 25, 2011, 01:33:55 PM »
Code: [Select]
scr1& = _NEWIMAGE(500, 500, 32)
SCREEN scr1&
CLS , _RGB(255, 0, 255)
END

You are confusing CLS background color with _CLEARCOLOR which makes the color transparent so you DO NOT see it.
QB64 WIKI: Main Page
Download Q-Basics Code Demo: Q-Basics.zip
Download QB64 BAT, IconAdder and VBS shortcuts: QB64BAT.zip
Download QB64 DLL files in a ZIP: Program64.zip

funkheld

  • Full Member
  • ***
  • Posts: 229
    • Email
Re: _clearcolor not funktion
« Reply #11 on: June 25, 2011, 02:08:04 PM »
ah...., "_clearcolor" is "_transcolor"   for the picture(sprite) :D

gruss

Clippy

  • Hero Member
  • *****
  • Posts: 16431
  • I LOVE π = 4 * ATN(1)    Use the QB64 WIKI >>>
    • Pete's Qbasic Site
    • Email
Re: _clearcolor not funktion
« Reply #12 on: June 25, 2011, 02:16:35 PM »
Yes, use _CLEARCOLOR to get rid of the background color so you don't see it.

32 bit screens will have the black background as clear by default. CLS alone will make the background color solid or opaque.
QB64 WIKI: Main Page
Download Q-Basics Code Demo: Q-Basics.zip
Download QB64 BAT, IconAdder and VBS shortcuts: QB64BAT.zip
Download QB64 DLL files in a ZIP: Program64.zip

funkheld

  • Full Member
  • ***
  • Posts: 229
    • Email
Re: _clearcolor not funktion
« Reply #13 on: June 26, 2011, 01:12:17 AM »
You can not change the name _clearcolor in the _transcolor  ???

Galleon

  • Administrator
  • Hero Member
  • *****
  • Posts: 4664
  • QB Forever
    • Email
Re: _clearcolor not funktion
« Reply #14 on: June 26, 2011, 02:07:48 AM »
Sorry for the confusion about the meaning of keywords. Even if we called it _TRANSCOLOR people might think of it as 'transition color'. If it annoys you a lot, make a TRANSCOLOR sub for yourself!
Code: [Select]
SUB TRANSCOLOR (col&, image&)
_CLEARCOLOR col&, image&
END SUB

Another bug misunderstanding corrected, thanks to everyone for investigating this for Funkheld. We are left with just one important question though. Did ping mean the color pink?
Something old... Something new... Something borrowed... Something blue...

  • Print