Click here to Skip to main content
15,887,776 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Converting to c++ local variable Pin
Matthew Faithfull10-Oct-07 0:55
Matthew Faithfull10-Oct-07 0:55 
GeneralRe: Converting to c++ local variable Pin
Exelioindia10-Oct-07 1:54
Exelioindia10-Oct-07 1:54 
GeneralRe: Converting to c++ local variable Pin
Matthew Faithfull10-Oct-07 1:58
Matthew Faithfull10-Oct-07 1:58 
AnswerRe: Converting to c++ local variable Pin
David Crow10-Oct-07 3:26
David Crow10-Oct-07 3:26 
AnswerRe: Converting to c++ local variable Pin
toxcct10-Oct-07 3:47
toxcct10-Oct-07 3:47 
QuestionTrackbar/Sliderbar problem Pin
scody10-Oct-07 0:46
scody10-Oct-07 0:46 
AnswerRe: Trackbar/Sliderbar problem Pin
Nishad S10-Oct-07 2:54
Nishad S10-Oct-07 2:54 
Questionhow to make bitmap display independent of Device Display Setting Pin
Sharath Jagannath9-Oct-07 23:55
Sharath Jagannath9-Oct-07 23:55 
I deal with grayscale images which i convert to 32bit bitmaps to display...
I use CreateCompatibleBitmap () to create bitmap and bitblt () to display bitmap. But if i change the system display settings to other than 32 bit colors i get distorted images displayed

I use following code:

int k = 0;
for (int i = 0; i < bm_info.bmWidth * bm_info.bmHeight; i++)
{
tbmp [k++] = bmp[i];
tbmp [k++] = bmp[i];
tbmp [k++] = bmp[i];
tbmp [k++] = 0;
}

CDC pMemDC, *pDC;
CBitmap *pBitmap = new CBitmap;
BOOL res;

pDC = GetDC();
res = pBitmap->CreateCompatibleBitmap (pDC,bm_info.bmWidth,bm_info.bmHeight);
if (res > 0)
{
pBitmap->SetBitmapBits ( bm_info.bmWidth * bm_info.bmHeight*4,
(unsigned char *)tbmp );
pMemDC.CreateCompatibleDC ( pDC );
pMemDC.SelectObject ( pBitmap );
pDC->BitBlt ( 300 ,15 , bm_info.bmWidth,bm_info.bmHeight ,
&pMemDC ,0,0 ,SRCCOPY );
}

all help appreciated... ( sample code is more appreciated Wink | ;) )

Sharath
AnswerRe: how to make bitmap display independent of Device Display Setting Pin
Nelek10-Oct-07 1:04
protectorNelek10-Oct-07 1:04 
AnswerRe: how to make bitmap display independent of Device Display Setting Pin
Mark Salsbery10-Oct-07 5:54
Mark Salsbery10-Oct-07 5:54 
GeneralRe: how to make bitmap display independent of Device Display Setting Pin
Sharath Jagannath10-Oct-07 18:44
Sharath Jagannath10-Oct-07 18:44 
GeneralRe: how to make bitmap display independent of Device Display Setting Pin
Nelek10-Oct-07 20:31
protectorNelek10-Oct-07 20:31 
GeneralRe: how to make bitmap display independent of Device Display Setting Pin
Sharath Jagannath10-Oct-07 20:41
Sharath Jagannath10-Oct-07 20:41 
GeneralFormule founded Pin
Nelek10-Oct-07 20:36
protectorNelek10-Oct-07 20:36 
GeneralRe: how to make bitmap display independent of Device Display Setting Pin
Mark Salsbery11-Oct-07 5:40
Mark Salsbery11-Oct-07 5:40 
QuestionHow to track windows messages of a 3rd party app Pin
dudedotnet9-Oct-07 23:54
dudedotnet9-Oct-07 23:54 
AnswerRe: How to track windows messages of a 3rd party app Pin
Matthew Faithfull10-Oct-07 0:50
Matthew Faithfull10-Oct-07 0:50 
GeneralRe: How to track windows messages of a 3rd party app Pin
dudedotnet10-Oct-07 0:56
dudedotnet10-Oct-07 0:56 
GeneralRe: How to track windows messages of a 3rd party app Pin
Matthew Faithfull10-Oct-07 1:04
Matthew Faithfull10-Oct-07 1:04 
GeneralRe: How to track windows messages of a 3rd party app Pin
dudedotnet10-Oct-07 1:17
dudedotnet10-Oct-07 1:17 
GeneralRe: How to track windows messages of a 3rd party app Pin
Matthew Faithfull10-Oct-07 1:55
Matthew Faithfull10-Oct-07 1:55 
GeneralRe: How to track windows messages of a 3rd party app Pin
dudedotnet10-Oct-07 1:58
dudedotnet10-Oct-07 1:58 
QuestionAt a Single console Pin
Jhony george9-Oct-07 23:54
Jhony george9-Oct-07 23:54 
GeneralRe: At a Single console Pin
Matthew Faithfull10-Oct-07 0:34
Matthew Faithfull10-Oct-07 0:34 
GeneralRe: At a Single console Pin
Jhony george10-Oct-07 0:36
Jhony george10-Oct-07 0:36 

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.