News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Iczelion Tutorial 5 help!!!

Started by EnFeR RoI, February 09, 2010, 03:51:23 AM

Previous topic - Next topic

EnFeR RoI

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

jj2007

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



EnFeR RoI

and my second question sir???

Thanks in advance.
EnFeR RoI. :bg

BlackVortex

It calls the RGB macro with those parameters.

RGB is a macro !

EnFeR RoI

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)

BlackVortex


dedndave

        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

RotateRight

#7
[]

EnFeR RoI

thanks all the members of masm for clearing my concept..

Thanks in advance.
EnFeR RoI.