The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: EnFeR RoI on February 09, 2010, 03:51:23 AM

Title: Iczelion Tutorial 5 help!!!
Post by: EnFeR RoI on February 09, 2010, 03:51:23 AM
Can anybody clear the concept of Iczelion few questions which i need to understand clearly.....

RGB macro red,green,blue
    xor    eax,eax
    mov  ah,blue
    shl     eax,8
    mov  ah,green
    mov  al,red
endm

Explain each line of RGB macro code


2)
  invoke SelectObject, hdc, eax
        mov    hfont,eax
        RGB    200,200,50
        invoke SetTextColor,hdc,eax
        RGB    0,0,255
        invoke SetBkColor,hdc,eax
        invoke TextOut,hdc,0,0,ADDR TestString,SIZEOF TestString
        invoke SelectObject,hdc, hfont
        invoke EndPaint,hWnd, ADDR ps
What is the meaning of 3 and 5 line that is RGB 200,200,50 and RGB 0,0,255.
Is this the color code of Text Color and Background color??? 


Explain in your own way!!!

Thanks in advance. :8)
EnFeR RoI
Title: Re: Iczelion Tutorial 5 help!!!
Post by: jj2007 on February 09, 2010, 03:56:15 AM
RGB macro red,green,blue
    xor    eax,eax  ; mov eax, 0
    mov  ah,blue  ; mov eax, 256*blue
    shl     eax,8  ; move to the B position
    mov  ah,green  ; move green to the G position
    mov  al,red  ; add the R
endm

ex R=12h, g=34h, b=56h
mov ah, 56h  ; eax=00005600h
shl     eax,8  ; eax=00560000h
mov  ah, 34  ; eax=00563400h
mov al, 12  ; eax=00563412


Title: Re: Iczelion Tutorial 5 help!!!
Post by: EnFeR RoI on February 09, 2010, 03:59:13 AM
and my second question sir???

Thanks in advance.
EnFeR RoI. :bg
Title: Re: Iczelion Tutorial 5 help!!!
Post by: BlackVortex on February 09, 2010, 04:24:14 AM
It calls the RGB macro with those parameters.

RGB is a macro !
Title: Re: Iczelion Tutorial 5 help!!!
Post by: EnFeR RoI on February 09, 2010, 04:28:11 AM
thanks for reply if i want other color than RGB,what is the code and where i get a list of color code???

For  example:- if you want pure red color, you should use 255,0,0. Or if you want pure white color, you must use 255,255,255.

Thanks in advance.
EnFeR RoI. :8)
Title: Re: Iczelion Tutorial 5 help!!!
Post by: BlackVortex on February 09, 2010, 04:30:06 AM
Go here :
http://www.pagetutor.com/colorpicker/index.html

Pick the colors, see the hex codes
:green2

Title: Re: Iczelion Tutorial 5 help!!!
Post by: dedndave on February 09, 2010, 04:33:11 AM
        RGB    200,200,50
        invoke SetTextColor,hdc,eax
        RGB    0,0,255
        invoke SetBkColor,hdc,eax

the RGB macro places the 3 colours into EAX
the text colour is set to red 200, green 200, and blue 50
the background colour is set to red 0, green 0, and blue 255
(which sounds like it wouldn't be very pretty)

if you put all possible colours in a text table, it would have 16,777,216 entries - that's a long table
but, you have the right idea - medium grey is 127,127,127
if you GOOGLE, there are colour tables all over the place
Title: Re: Iczelion Tutorial 5 help!!!
Post by: RotateRight on February 09, 2010, 04:33:55 AM
[]
Title: Re: Iczelion Tutorial 5 help!!!
Post by: EnFeR RoI on February 09, 2010, 05:37:52 AM
thanks all the members of masm for clearing my concept..

Thanks in advance.
EnFeR RoI.