Click here to Skip to main content
15,891,951 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Monochrome Bitmap Issue Pin
Bram van Kampen30-May-07 14:28
Bram van Kampen30-May-07 14:28 
AnswerRe: Monochrome Bitmap Issue Pin
Mark Salsbery30-May-07 15:16
Mark Salsbery30-May-07 15:16 
GeneralRe: Monochrome Bitmap Issue Pin
CoffeeAddict1930-May-07 17:08
CoffeeAddict1930-May-07 17:08 
GeneralRe: Monochrome Bitmap Issue Pin
Mark Salsbery31-May-07 5:36
Mark Salsbery31-May-07 5:36 
GeneralRe: Monochrome Bitmap Issue Pin
CoffeeAddict1931-May-07 8:19
CoffeeAddict1931-May-07 8:19 
GeneralRe: Monochrome Bitmap Issue Pin
CoffeeAddict1931-May-07 8:38
CoffeeAddict1931-May-07 8:38 
GeneralRe: Monochrome Bitmap Issue Pin
Mark Salsbery31-May-07 8:53
Mark Salsbery31-May-07 8:53 
GeneralRe: Monochrome Bitmap Issue [modified] Pin
Mark Salsbery31-May-07 8:43
Mark Salsbery31-May-07 8:43 
CoffeeAddict19 wrote:
indicating that ScreenDC was null


Is Create() failing? Never mind, I see you fixed the ASSERT


I steered you wrong with the CreateCompatibleDC, sorry D'Oh! | :doh:
*EDIT* I DID show you a way to do what you were already doing though :)

This should work from anywhere:
CWindowDC ScreenDC(0);
 
CBitmap bitmap;
bitmap.CreateCompatibleBitmap(&ScreenDC, 20, 20);
 
//**Test - Check the resulting bitmap's format...
BITMAP bitmapstruct;
bitmap.GetObject(sizeof(BITMAP), &bitmapstruct);

You'll see in the BITMAP struct, the format matches the screen format.

Try this:
CreateResult = CWnd::Create(CPIEGRAPH_CLASSNAME, _T(""), dwStyle, rect, pParentWnd, nID);
CWindowDC ScreenDC(0);
TextDCResult = TextMemDC.CreateCompatibleDC(&ScreenDC);
PieDCResult = PieMemDC.CreateCompatibleDC(&ScreenDC);
SelectText = m_textBitmap.CreateCompatibleBitmap(&ScreenDC, 250, 20);
SelectPie = m_pieBitmap.CreateCompatibleBitmap(&ScreenDC, 300, 300);

Mark


-- modified at 14:54 Thursday 31st May, 2007

"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder

GeneralRe: Monochrome Bitmap Issue Pin
CoffeeAddict1931-May-07 9:58
CoffeeAddict1931-May-07 9:58 
GeneralRe: Monochrome Bitmap Issue Pin
Mark Salsbery31-May-07 10:05
Mark Salsbery31-May-07 10:05 
Questiontable and vector, C++ Pin
C_Zealot30-May-07 11:39
C_Zealot30-May-07 11:39 
GeneralRe: table and vector, C++ Pin
C_Zealot30-May-07 11:42
C_Zealot30-May-07 11:42 
AnswerRe: table and vector, C++ Pin
Rajkumar R31-May-07 1:16
Rajkumar R31-May-07 1:16 
GeneralRe: table and vector, C++ Pin
C_Zealot31-May-07 1:18
C_Zealot31-May-07 1:18 
QuestionDirectshow : Connect to another process's graph... Pin
Akin Ocal30-May-07 11:36
Akin Ocal30-May-07 11:36 
AnswerRe: Directshow : Connect to another process's graph... Pin
Mark Salsbery30-May-07 15:19
Mark Salsbery30-May-07 15:19 
QuestionConnect to another process's graph... Pin
Akin Ocal30-May-07 11:35
Akin Ocal30-May-07 11:35 
QuestionMonitor Memory for Alterations Pin
Jeffrey Walton30-May-07 11:25
Jeffrey Walton30-May-07 11:25 
AnswerRe: Monitor Memory for Alterations Pin
Matthew Faithfull30-May-07 12:58
Matthew Faithfull30-May-07 12:58 
GeneralRe: Monitor Memory for Alterations Pin
Jeffrey Walton30-May-07 14:03
Jeffrey Walton30-May-07 14:03 
GeneralRe: Monitor Memory for Alterations Pin
Matthew Faithfull30-May-07 22:40
Matthew Faithfull30-May-07 22:40 
GeneralRe: Monitor Memory for Alterations Pin
Jeffrey Walton30-May-07 23:00
Jeffrey Walton30-May-07 23:00 
QuestionInternal class Pin
R Thompson30-May-07 10:28
R Thompson30-May-07 10:28 
QuestionRe: Internal class Pin
Mark Salsbery30-May-07 10:40
Mark Salsbery30-May-07 10:40 
AnswerRe: Internal class Pin
R Thompson30-May-07 10:50
R Thompson30-May-07 10:50 

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.