Results 1 to 5 of 5

Thread: Changing individual colours on a palette

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2002
    Posts
    4

    Changing individual colours on a palette

    Hi

    Can someone explain this whole confusing subject.

    What I'm TRYING to do (and I thought it was going to be simple!)
    is this:

    I have a bitmap. On this picture (amongst other things) is a box filled with 3 colours.

    I want to specifiy these three colours by their PALETTE INDEX (is there such a thing) and then change those 3 colours at runtime.

    I want all the system colours and all the other colours to remain the same. Which is why I figured I had to use a 256 colour bitmap and leave the first 20 as is, and colour my 'box' with 3 colours from the palette after 20.

    How do I know what the index is of the palette and make sure I color the bitmap in with the correct palette index? I'm using Photoshop 6 or Windows Paint.

    I'm using VB 6 SP5 and it's now 1130am, I've been at this since 0740 and I STILL can't find anything that would help unless I knew how to program C++!!! Grrrrrr

    Thanks

    X

  2. #2
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Try windowed DirectDraw:
    http://www.directx4vb.com/.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2002
    Posts
    4
    THanks

    Couldn't find a thing about it there...

    BUT

    I don't want to do this in DX

    I want to do it on a bmp on a form in a VB app.

    In almost every other language I've played with it was a given that you specify individual palette colours.

    Even on C64's or Vic20's you could 'POKE' the values in...

    You mean that this can't be done in pure VB??

    Arrgghh!

    Not even in VB.Net?

    X

  4. #4
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    VB was originally intended for high-level database programming, not graphics That's why we don't have direct access to bitmaps or anything really for that matter. Look into 256 colour DIB sections, then. You'll be able to get some speed on that...
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  5. #5
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    The .NET framework allows for it with the Image class (which stores data as a DIB section btw).

    System.Drawing.Image
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

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



Click Here to Expand Forum to Full Width