Click here to Skip to main content
15,897,704 members
Home / Discussions / Graphics
   

Graphics

 
NewsRe: draw a line inside a circle Pin
akirilov24-Apr-09 3:07
akirilov24-Apr-09 3:07 
GeneralRe: draw a line inside a circle Pin
akirilov24-Apr-09 3:17
akirilov24-Apr-09 3:17 
QuestionBITMAPINFO + Colour video Pin
jossion23-Feb-09 22:14
jossion23-Feb-09 22:14 
QuestionRe: BITMAPINFO + Colour video Pin
Mark Salsbery24-Feb-09 5:41
Mark Salsbery24-Feb-09 5:41 
AnswerRe: BITMAPINFO + Colour video Pin
jossion24-Feb-09 16:52
jossion24-Feb-09 16:52 
GeneralRe: BITMAPINFO + Colour video Pin
Mark Salsbery25-Feb-09 10:30
Mark Salsbery25-Feb-09 10:30 
GeneralRe: BITMAPINFO + Colour video Pin
jossion25-Feb-09 16:17
jossion25-Feb-09 16:17 
GeneralRe: BITMAPINFO + Colour video Pin
Mark Salsbery26-Feb-09 6:14
Mark Salsbery26-Feb-09 6:14 
To create the DIBSection, you can drop the palette and change the bmiHeader.biBitCount:
BITMAPINFO *bm = (BITMAPINFO *)new BYTE[sizeof(BITMAPINFO)];

bm->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bm->bmiHeader.biWidth = 176;
bm->bmiHeader.biHeight = 144;
bm->bmiHeader.biPlanes = 1;
bm->bmiHeader.biBitCount = 24;
bm->bmiHeader.biCompression = BI_RGB;
bm->bmiHeader.biSizeImage = 0;
bm->bmiHeader.biXPelsPerMeter = 0;
bm->bmiHeader.biYPelsPerMeter = 0;
bm->bmiHeader.biClrUsed = 0;
bm->bmiHeader.biClrImportant = 0;

BYTE *pBitmapBits;
HBITMAP hBitmap = ::CreateDIBSection(NULL, bm, DIB_RGB_COLORS, (void**)&pBitmapBits, NULL, 0);

if (hBitmap)
{

    // do your rendering stuff here!


    ::DeleteObject(hBitmap);
}

delete[] (BYTE *)bm;

jossion wrote:
I have 8 bits of R,8 bits of G and 8 bits of B seperately in seperate arrays


The pixel data (pointed to by pBitmapBits) will now be a RGBTRIPLE struct for each pixel:
// From the docs:

typedef struct tagRGBTRIPLE { 
  BYTE rgbtBlue; 
  BYTE rgbtGreen; 
  BYTE rgbtRed; 
} RGBTRIPLE;

You'll need to take the individual RGB component bytes from the arrays and
pack them in the RGBTRIPLE format - BGRBGRBGR...


Mark

Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

GeneralRe: BITMAPINFO + Colour video Pin
akirilov24-Apr-09 3:25
akirilov24-Apr-09 3:25 
GeneralRe: BITMAPINFO + Colour video Pin
Mark Salsbery24-Apr-09 5:57
Mark Salsbery24-Apr-09 5:57 
Questioncan not draw polygon using gluTessCallback() function Pin
King Tran20-Feb-09 22:34
King Tran20-Feb-09 22:34 
Questionplz Help ZedGraph Pin
Vampirejk18-Feb-09 2:01
Vampirejk18-Feb-09 2:01 
AnswerRe: plz Help ZedGraph Pin
Drew Stainton25-Feb-09 11:49
Drew Stainton25-Feb-09 11:49 
QuestionFlash MX action script redirection Pin
annu0818-Feb-09 1:50
annu0818-Feb-09 1:50 
QuestionUsing GDI over OpenGL in Vista Pin
Gastello16-Feb-09 22:50
Gastello16-Feb-09 22:50 
QuestionManaged DirectX AudioVideoPlayBack Problems Pin
sibinsunny12-Feb-09 23:36
sibinsunny12-Feb-09 23:36 
AnswerRe: Managed DirectX AudioVideoPlayBack Problems [modified] Pin
miljanrajkovic5-May-09 0:26
miljanrajkovic5-May-09 0:26 
Generalerer Pin
KCMANDAL12-Feb-09 0:09
KCMANDAL12-Feb-09 0:09 
Generalvery important Pin
KCMANDAL11-Feb-09 22:35
KCMANDAL11-Feb-09 22:35 
JokeRe: very important Pin
Nishad S11-Feb-09 23:21
Nishad S11-Feb-09 23:21 
GeneralRe: very important Pin
Smithers-Jones13-Feb-09 0:15
Smithers-Jones13-Feb-09 0:15 
GeneralRe: very important Pin
Dave Kreskowiak13-Feb-09 5:12
mveDave Kreskowiak13-Feb-09 5:12 
Questionrefresh device context? Pin
Member 19061757-Feb-09 10:53
Member 19061757-Feb-09 10:53 
AnswerRe: refresh device context? Pin
plexted1-Nov-09 2:35
plexted1-Nov-09 2:35 
QuestionConvert PCL to image Pin
Cosmin Ciuraru29-Jan-09 6:16
Cosmin Ciuraru29-Jan-09 6:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.