Click here to Skip to main content
16,013,207 members
Home / Discussions / Graphics
   

Graphics

 
AnswerRe: windows grapics system and mouse movement Pin
Waldermort24-Feb-07 22:54
Waldermort24-Feb-07 22:54 
AnswerRe: windows grapics system and mouse movement Pin
John R. Shaw3-Mar-07 1:33
John R. Shaw3-Mar-07 1:33 
QuestionUrgent :Windows and multi monitor query Pin
bil_geo24-Feb-07 19:42
bil_geo24-Feb-07 19:42 
AnswerRe: Urgent :Windows and multi monitor query Pin
Christian Graus26-Feb-07 9:44
protectorChristian Graus26-Feb-07 9:44 
QuestionC++/MFC - Problem with GDI+ Bitmap::GetHBITMAP() Pin
PJ Arends23-Feb-07 11:37
professionalPJ Arends23-Feb-07 11:37 
QuestionRe: C++/MFC - Problem with GDI+ Bitmap::GetHBITMAP() Pin
Mark Salsbery24-Feb-07 9:59
Mark Salsbery24-Feb-07 9:59 
AnswerRe: C++/MFC - Problem with GDI+ Bitmap::GetHBITMAP() Pin
PJ Arends24-Feb-07 10:13
professionalPJ Arends24-Feb-07 10:13 
GeneralRe: C++/MFC - Problem with GDI+ Bitmap::GetHBITMAP() [modified] Pin
Mark Salsbery24-Feb-07 15:34
Mark Salsbery24-Feb-07 15:34 
Got interrupted by g/f for lunch and a movie LOL.

Anyway that is unexpected behavior to me as well.

I've been playing with the following code. I can get two background colors, blue and black,
no matter what "clr" I use and no matter how I construct the Color object.
The source image is 320x240 GIF transparent background and a couple squiggly colored brush strokes
on it.
The first DrawImage() renders it transparently fine.
Confused | :confused:
For my own reference I'd like to know what's up Smile | :)
//This code in a CWnd method...
 
   Gdiplus::Bitmap SrcBitmap(L"C:\\test.gif", FALSE);
 
   Graphics DstGraphics(*this);
   DstGraphics.DrawImage(&SrcBitmap, 50, 50, SrcBitmap.GetWidth(), SrcBitmap.GetHeight());
 
//   COLORREF BackGround = RGB(0xFF,0xFF,0xFF);
//   Gdiplus::Color clr;
//   clr.SetFromCOLORREF(BackGround);
   Gdiplus::Color clr(0x00,0xFF,0xFF,0xFF);
 
   HBITMAP bmp;
   if (Gdiplus::Ok == SrcBitmap.GetHBITMAP(clr, &bmp))
   {
//      BITMAP bitmapstruct;
//      GetObject((HGDIOBJ)bmp, sizeof(BITMAP), &bitmapstruct);
 
      HDC hMemDC = ::CreateCompatibleDC(0);
      HDC hDestDC = ::GetDC(*this);
 
      HGDIOBJ hOldBitmap = ::SelectObject(hMemDC, (HGDIOBJ)bmp);
 
      ::StretchBlt(hDestDC, 0, 0, 160, 120, hMemDC, 0, 0, 320, 240, SRCCOPY);
 
      ::SelectObject(hMemDC, hOldBitmap);
 
      ::ReleaseDC(*this, hDestDC);
      ::DeleteDC(hMemDC);
       ::DeleteObject((HGDIOBJ)bmp);
   }







-- modified at 21:40 Saturday 24th February, 2007

"Do you know what it's like to fall in the mud and get kicked... in the head... with an iron boot?
Of course you don't, no one does. It never happens. It's a dumb question... skip it."
(Rex Kramer "Airplane!")

GeneralRe: C++/MFC - Problem with GDI+ Bitmap::GetHBITMAP() Pin
PJ Arends24-Feb-07 15:43
professionalPJ Arends24-Feb-07 15:43 
GeneralRe: C++/MFC - Problem with GDI+ Bitmap::GetHBITMAP() Pin
Mark Salsbery24-Feb-07 16:24
Mark Salsbery24-Feb-07 16:24 
GeneralRe: C++/MFC - Problem with GDI+ Bitmap::GetHBITMAP() Pin
PJ Arends25-Feb-07 6:40
professionalPJ Arends25-Feb-07 6:40 
GeneralRe: C++/MFC - Problem with GDI+ Bitmap::GetHBITMAP() Pin
Mark Salsbery25-Feb-07 6:58
Mark Salsbery25-Feb-07 6:58 
GeneralRe: C++/MFC - Problem with GDI+ Bitmap::GetHBITMAP() Pin
PJ Arends25-Feb-07 8:51
professionalPJ Arends25-Feb-07 8:51 
GeneralRe: C++/MFC - Problem with GDI+ Bitmap::GetHBITMAP() Pin
Mark Salsbery25-Feb-07 9:02
Mark Salsbery25-Feb-07 9:02 
GeneralRe: C++/MFC - Problem with GDI+ Bitmap::GetHBITMAP() Pin
Mark Salsbery25-Feb-07 9:33
Mark Salsbery25-Feb-07 9:33 
GeneralRe: C++/MFC - Problem with GDI+ Bitmap::GetHBITMAP() Pin
PJ Arends25-Feb-07 9:39
professionalPJ Arends25-Feb-07 9:39 
GeneralRe: C++/MFC - Problem with GDI+ Bitmap::GetHBITMAP() Pin
PJ Arends25-Feb-07 12:20
professionalPJ Arends25-Feb-07 12:20 
GeneralRe: C++/MFC - Problem with GDI+ Bitmap::GetHBITMAP() Pin
Mark Salsbery26-Feb-07 7:30
Mark Salsbery26-Feb-07 7:30 
GeneralRe: C++/MFC - Problem with GDI+ Bitmap::GetHBITMAP() Pin
Mark Salsbery26-Feb-07 8:47
Mark Salsbery26-Feb-07 8:47 
GeneralRe: C++/MFC - Problem with GDI+ Bitmap::GetHBITMAP() Pin
PJ Arends26-Feb-07 9:31
professionalPJ Arends26-Feb-07 9:31 
GeneralRe: C++/MFC - Problem with GDI+ Bitmap::GetHBITMAP() Pin
Mark Salsbery26-Feb-07 9:52
Mark Salsbery26-Feb-07 9:52 
GeneralRe: C++/MFC - Problem with GDI+ Bitmap::GetHBITMAP() Pin
PJ Arends26-Feb-07 10:19
professionalPJ Arends26-Feb-07 10:19 
AnswerRe: C++/MFC - Problem with GDI+ Bitmap::GetHBITMAP() Pin
PJ Arends24-Feb-07 10:16
professionalPJ Arends24-Feb-07 10:16 
AnswerRe: C++/MFC - Problem with GDI+ Bitmap::GetHBITMAP() Pin
Waldermort24-Feb-07 14:02
Waldermort24-Feb-07 14:02 
GeneralRe: C++/MFC - Problem with GDI+ Bitmap::GetHBITMAP() Pin
PJ Arends24-Feb-07 15:08
professionalPJ Arends24-Feb-07 15:08 

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.