Files |  Tutorials |  Articles |  Links |  Home |  Team |  Forum |  Wiki |  Impressum

Aktuelle Zeit: So Jul 20, 2025 18:05

Foren-Übersicht » English » English Programming Forum
Unbeantwortete Themen | Aktive Themen



Ein neues Thema erstellen Auf das Thema antworten  [ 1 Beitrag ] 
Autor Nachricht
BeitragVerfasst: Di Aug 03, 2004 12:01 
Hi all,

I'm not really into Delphi, in fact I use Borland C++ Builder, but it shouldn't be a problem. I'm trying to render on a bitmap in BC++ Builder 5.0. I read in MSDN (which, unfortunately, deals with M$ stuff, not Borland) that the number of bits per pixels for the bitmap should be equal to that in the PIXELFORMATDESCRIPTOR. So here's the code:

Code:
  1.  
  2. prBM = new Graphics::TBitmap;
  3. prBM->PixelFormat = pf24bit;
  4. hdc = prBM->Canvas->Handle;   // is this the right handle to use here?
  5.  
  6. PIXELFORMATDESCRIPTOR pfd = {
  7.  sizeof(PIXELFORMATDESCRIPTOR),
  8.  1,
  9.  PFD_DRAW_TO_BITMAP | PFD_SUPPORT_OPENGL | PFD_SUPPORT_GDI,
  10.  PFD_TYPE_RGBA,
  11.  24,
  12.  0,0,0,0,0,0,
  13.  0,0,
  14.  0,0,0,0,0,
  15.  32,
  16.  0,
  17.  0,
  18.  PFD_MAIN_PLANE,
  19.  0,
  20.  0,0,0
  21. };
  22.  
  23. PixelFormat = ChoosePixelFormat(hdc, &pfd);
  24. if (!SetPixelFormat(hdc, PixelFormat, &pfd))
  25.     ShowMessage("Pixel format not set");
  26.  
  27.  


I guess that I got the flags alright. ChoosePixelFormat returns some stuff (so it's not NULL), but SetPixelFormat doesn't work. So I wonder what I did wrong?

So far, my main doubts are about the handle "hdc". In MSDN they operate with DIBsections. - But here, I use Borland's own TBitmap. Borland fans - does anyone know where's the problem? Thanx!

I absolutely need to render stuff on a TBitmap (my supervisor requires that, so...), and I couldn't get help on opengl.org forums :( Please help me, or at least drop a link where to look for a solution.


Nach oben
  
Mit Zitat antworten  
Beiträge der letzten Zeit anzeigen:  Sortiere nach  
Ein neues Thema erstellen Auf das Thema antworten  [ 1 Beitrag ] 
Foren-Übersicht » English » English Programming Forum


Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 5 Gäste


Du darfst keine neuen Themen in diesem Forum erstellen.
Du darfst keine Antworten zu Themen in diesem Forum erstellen.
Du darfst deine Beiträge in diesem Forum nicht ändern.
Du darfst deine Beiträge in diesem Forum nicht löschen.
Du darfst keine Dateianhänge in diesem Forum erstellen.

Suche nach:
Gehe zu:  
cron
  Powered by phpBB® Forum Software © phpBB Group
Deutsche Übersetzung durch phpBB.de
[ Time : 0.007s | 14 Queries | GZIP : On ]