Questions tagged [dib]

DIB is a Device Independent Bitmap

Refer to https://en.wikipedia.org/wiki/Device-independent_bitmap for more details.

51 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
5
votes
3 answers

What is Windows DIB?

I was just discussing if there was an alternative windows graphics library to GDI & Direct X in a forum. Someone mentioned WinDIB. Sadly, he didn't explain more about it. Now I've searched google. There seems to be no Wikipedia article on Windows…
ApprenticeHacker
  • 21,351
  • 27
  • 103
  • 153
5
votes
1 answer

What are the differences between a Windows bitmap and DIBSection?

I'm loading a DIBSection from a file with the following: HBITMAP bmpIn = (HBITMAP) LoadImage(NULL, _T("c:\\Temp\\Temp.bmp"), IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION | LR_LOADFROMFILE); Empirically I've discovered the following differences between…
Mark Ransom
  • 299,747
  • 42
  • 398
  • 622
5
votes
3 answers

C++: Hbitmap/BITMAP into .bmp file

Ok, whole story is, I am trying to use Leptonica+Tesseract OCR in C++ to take a screenshot, save it to a *.bmp file, then load it back up to OCR with it. I won't need to do this frequently, but as I cannot seem to copy the screenshot data directly…
user3285714
  • 75
  • 1
  • 1
  • 5
4
votes
1 answer

How to bring "System.Drawing.Image" to DIB

I have created a consumable COM Class Library. The class library gets the image of a camera. It's of type Image / Bitmap. I consume the class library in VB6, and I need to show this image in VB6. How could I convert this System.Drawing.Image to…
tmighty
  • 10,734
  • 21
  • 104
  • 218
4
votes
2 answers

MFC BitBlt and SetDIBits vs. SetBitmapBits

I have a bitmap stored as a BGRA array of bytes. This is the code I've been using to paint the bitmap: CDC *dispDC = new CDC(); dispDC->CreateCompatibleDC(pDC); CBitmap *dispBMP = new CBitmap(); dispBMP->CreateCompatibleBitmap(pDC,…
darda
  • 3,597
  • 6
  • 36
  • 49
3
votes
1 answer

DIB to Tbitmap code manipulation to adapt PNG images?

I use this code to convert DIB to TBitmap, so how can i manipulate this code to be suitable to a PNG image (preseving its transparency)? I tired to set the Transparent property to true but it seems that the code was made for 256 color bitmap. code…
Sara S.
  • 1,365
  • 1
  • 15
  • 33
3
votes
2 answers

GetDiBits: different dimensions passed in BITMAPINFOHEADER

I have some questions regarding GetDiBits, based on my experience with this function. By mistake I have created a bitmap double the size I needed: HBITMAP hBmpSection = CreateCompatibleBitmap(ScreenDC, 2 * radius, 2 * radius); I did not notice…
sergiu reznicencu
  • 1,039
  • 1
  • 11
  • 31
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
3
votes
2 answers

SetDIBitsToDevice emulation

I'm gho author of the DxWnd tool that tries to provide support to run old and legacy programs on modern windows environment. A very strange game is G-Nome that, despite being able to run natively on Win7-10 systems, brings a serious problem for…
gho
  • 121
  • 6
3
votes
1 answer

Fastest method for blitting from a pixel buffer into a device context

Good evening, I have several 32-bit images in memory buffers that I wish to "blit" to a device context, quickly. Speed is an issue here because the buffer will be manipulated constantly and need to be blitted to the DC repeatedly. The color depth of…
user579480
  • 115
  • 2
  • 7
3
votes
1 answer

Capture screen shot with mouse cursor

I have used the following code to get screen shot on Windows. hdcMem = CreateCompatibleDC (hdc) ; int cx = GetDeviceCaps (hdc, HORZRES); int cy = GetDeviceCaps (hdc, VERTRES); HBITMAP hBitmap(NULL); hBitmap = CreateCompatibleBitmap (hdc, cx,…
KenC
  • 127
  • 2
  • 9
2
votes
1 answer

How to convert DIB to TPNGObject?

I have a DIB handle. How can I convert it to TPNGObject with preserving its transparency? EDIT : I use method 2 in this solution Here but the bitmap resulted is not transparent even if i set its Transparent Flag with true
Sara S.
  • 1,365
  • 1
  • 15
  • 33
2
votes
3 answers

How much memory should be allocated for the DIB data received from HBITMAP using GetDIBits function?

How much memory should be allocated for the DIB data received from HBITMAP using GetDIBits function? The GetDIBits function is described in MSDN as follow: int GetDIBits( __in HDC hdc, __in HBITMAP hbmp, __in UINT uStartScan, …
jondinham
  • 8,271
  • 17
  • 80
  • 137
2
votes
0 answers

C# image loses transparency when loaded in clipboard even with DIBv5 conversion

I'm trying to load an image file into the clipboard in order to then paste it in Discord with Ctrl+V. It is possible to paste a PNG into Discord and conserve the transparency, as I am able to right click to copy an image on Mozilla or Chrome and…
Krafpy
  • 336
  • 3
  • 8
1
2 3 4