Questions tagged [createdibsection]
19 questions
13
votes
3 answers
How to convert an Array of pixels to HBITMAP
I have an array of pixels which I need to convert to HBITMAP in order to display it in a window.
I tried to use CreateDIBitmap() but I don't have the BMP headers.
I tried to construct them manually according to MSDN documentation but this didn't…

DanielHsH
- 4,287
- 3
- 30
- 36
3
votes
1 answer
Understanding GetDiBits. C++
MSDN says that the bitmap used in GetDiBits should not be selected into a DC before calling this function. But from my experience(with BitBlt) I know that I cannot draw an a bitmap unless it is selected.
How does GetDiBits circumvents this? Can I…

sergiu reznicencu
- 1,039
- 1
- 11
- 31
2
votes
1 answer
Windows bitmaps: BITMAPV5HEADER and BITMAPINFO compatible?
From the documentation on CreateDIBSection I observe that CreateDIBSection takes a pointer to a BITMAPINFO as the second parameter.
However, I came across various places indicating that it might be allowed to pass pointers to other structures (in…

phimuemue
- 34,669
- 9
- 84
- 115
2
votes
1 answer
BitBlt + UpdateLayeredWindow and CreateDIBSection in 16-bit desktop color depth
I have an application with transparent background in client area which is drawn black because the window is not layered. In each of it's WM_PAINT messages I am doing a BitBlt to a memory-DC, after that I use the memory-DC with UpdateLayeredWindow to…

Chris
- 21
- 2
2
votes
2 answers
CreateDIBSection failed
BITMAPINFO bmi;
memset(&bmi,0,sizeof(BITMAPINFO));
bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bmi.bmiHeader.biWidth =m_pImg->GetWidth();
bmi.bmiHeader.biHeight =m_pImg->GetHeight();
bmi.bmiHeader.biPlanes …

user25749
- 4,825
- 14
- 61
- 83
2
votes
0 answers
Trying to write TBitmaps to AVI file and getting only black frames (all zero data)
I have a Delphi application that reads JPEG frames from a file and writes them to an AVI file. Each JPEG frame is decoded to a TBitmap object and then written to an output AVI file using the services provided by the Windows API DLL for AVI…

Robert Oschler
- 14,153
- 18
- 94
- 227
1
vote
0 answers
Why CreateDIBSection returns NULL while GetLastError returns 0 when the screen solution is changed?
Following is my code:
void Fun(int nScreenWidth, int nScreenHeight)
{
...
int nMemSize = nScreenWidth*nScreenHeight*3*7
HDC hdc = ::GetDC(hWnd);
int hBmpMapFile = ::CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, nMemSize,…

JetYi
- 11
- 2
1
vote
1 answer
CreateDibSection on Disk instead of physical memory
I am having a memory issue with an algorithm I am using to "Flatten" a page in a PDF document.
HBITMAP hbmp = CreateDibSection(...);
ThirdPartyBmpManipulation(hbmp, "C:\\file.pdf", 0); //renders page 0 in file.pdf
void * hdib = ConvertBitmap(hbmp);…

Tom Fobear
- 6,729
- 7
- 42
- 74
1
vote
1 answer
what to write in callback url file in dibs payment?
I have used a redirect method of payment using PHP. Can any one help with the callback file content?
I don't know what to define in callback.php file.
I can't find any help from any source.
I have already refereed below link about callback in…

Vijay Astound
- 75
- 8
1
vote
2 answers
about the call of CreateDIBSection in a thread
in a function named buildtexture, it loaded the image and build texture for OpenGL, when i called CreateDIBSection, it will creat a bitmap. If the function buildtexture was called as a normal member function, there will be nothing wrong. But if i…

snail
- 11
- 1
1
vote
0 answers
C# Type conversion when using CreateDIBSection
First, please read the Link
To using CreateDIBSection in c#, i defined like this.
[DllImport("gdi32.dll", EntryPoint = "CreateDIBSection")]
public static extern IntPtr CreateDIBSection(IntPtr hdc, ref BITMAPINFO pbmi,
uint…

user2194241
- 21
- 6
1
vote
1 answer
Bitblt,createdibsection, image comes out corrupted
hi im trying to capture screenshot but the image comes out corrupted, can anyone see whats wrong wth the code, basically im trying to use createdibsection so i can accesss the bits directly.
heres what the resulting picture…

Bol Baba
- 11
- 2
0
votes
1 answer
Saving pixels from screen HDC
Many forums give the following code regarding how to get into an array a copy of the screen's pixels:
char* Pixels = NULL;
HDC MemDC = CreateCompatibleDC(Context);
HBITMAP Section = CreateDIBSection(Context, &Info, DIB_RGB_COLORS, (void**)&Pixels,…

sergiu reznicencu
- 1,039
- 1
- 11
- 31
0
votes
1 answer
why CreateDIBSection() fails with certian BITMAPINFO?
I am trying to use CreateDIBSection.
Problem:
In Windows XP, I tried to call CreateDIBSection, it returns NULL and GetLastError = 0
When I try to change the screen resolution, for example to 2048 x 1536, it returns correct value.
I have tested this…

yyy
- 13
- 2
- 5
0
votes
1 answer
CreateDIBSection under the hood
I've been using WINAPI CreateDIBSection() to draw pixel by pixel then I bitblt to DC. I'm curious. What is going on with CreateDIBSection's underlying data structures? The BITMAPINFO struct stores the width height of the screen/client. Then the VOID…

James Rockford
- 21
- 1
- 4