×

Discussion Board

Results 1 to 2 of 2

Thread: Mapping colors

  1. #1
    Regular Contributor
    Join Date
    Feb 2004
    Location
    Phillippines
    Posts
    139

    Mapping colors

    Hey hi. Can anyone tell me how to make an TRgb Pair? I trying to use MapColors in the CWindowGc class. It requires some kind of TRgb pair.

  2. #2
    Regular Contributor
    Join Date
    Nov 2004
    Location
    Mumbai - India
    Posts
    155

    'MapColors' is not working ?

    I'm using DSA and prg is for series60.
    Code looks like this ......


    // --- Fill background with GREEN
    iDSAObj->iBackBufferGc->SetBrushColor(KRgbDarkGreen);
    iDSAObj->iBackBufferGc->Clear();

    // --- draw a bmp
    iDSAObj->iBackBufferGc->BitBlt(TPoint(0, 0),iBitmaps[0],TRect(0, 0, 64, 32));

    // ---- draw a RED border rect
    iDSAObj->iBackBufferGc->SetBrushColor(KRgbDarkRed);
    iDSAObj->iBackBufferGc->SetPenColor(KRgbDarkRed);
    iDSAObj->iBackBufferGc->SetPenSize(TSize(3,3));
    iDSAObj->iBackBufferGc->DrawRect(TRect(20, 20, 84, 92));

    // ---- create RGB pairs
    TRgb rgb2[] = { KRgbDarkGreen, (128,128,128), KRgbDarkRed, (0,0,0) };

    // --- called MapColors
    iDSAObj->iBackBufferGc->MapColors(TRect(20, 10, 52, 82), rgb2, 4);

    ----------------------------
    I tried with these two lines also. But nothing works.

    iDSAObj->iBackBufferGc->MapColors(TRect(20, 10, 52, 82), rgb2, 2);


    iDSAObj->iBackBufferGc->MapColors(TRect(20, 10, 52, 82), rgb2, 2, FALSE);



    MapColors dont works with series 60 ? or code is wrong ?


    Saur

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •