Questions tagged [hbitmap]

A handle to a bitmap (one of Windows Data Types)

HBITMAP is pointer to any type. But usually it is used for pointing on BITMAP object (one of Windows Data Types). See it's declaration:

typedef HANDLE HBITMAP; // see WinDef.h
typedef PVOID HANDLE;   // see WinNT.h
typedef void *PVOID;    // see WinNT.h
96 questions
0
votes
0 answers

save jpeg from hBitmap to BYTE array

Thanks in advance for your help :) In my code, I load a bitmap from my local computer, receiving in the end an HBITMAP structure. I would like to convert this hBitmap to JPEG and send it to a distant server side socket. By now, what I am able to…
David Labay
  • 3
  • 1
  • 4
0
votes
0 answers

How can I add text to my bitmap file in c++

With the code sample below, I have successfully created a .bmp file which when opened simply displays a grey square. Now I would like to add text to the bitmap before saving it. For example: "Hello World" in green should be displayed on top of the…
BeeLabeille
  • 174
  • 1
  • 4
  • 16
0
votes
1 answer

Getting RGB-values of a specific pixel from a HBITMAP

How to I get one specific pixels RGB-values from a HBITMAP? I tried reading similar posts at StackOverflow but none really fit this problem. The code below seems to get an RGB value for another position (not the wanted one) in the HBITMAP. int…
0
votes
1 answer

Working with HBitmaps

I'm trying to save some HBITMAPs into an array, and display them at a later time. Creating a HBITMAP from a DC works, but when I try to display a saved HBITMAP I seem to get the wrong one. This leads me to think that I haven't really understood how…
Marco
  • 1
  • 2
0
votes
1 answer

Logical matter for memory allocation while managing my objects in C++

I have some problem with my designs for function, and I do not find a proper solution (I am quite a beginner in C++). Some days ago, I ask another question which is linked to this one. So, I have a function that makes a screen capture. It works…
Delgan
  • 18,571
  • 11
  • 90
  • 141
0
votes
0 answers

Why does repeating call to createBitmapIndirect in WM_MOUSEMOVE eventually returns NULL?

I'm writing a complex color editing dialog box which contains a list view control and a photoshop-style HSV color picker. This dialog will be used as described: the user first clicks on the particular item, then manipulates cursor on the…
Antiusninja
  • 157
  • 1
  • 17
0
votes
1 answer

CListCtrl with CImageList access HBITMAP for modification

I have a CListCtrl containing a CImageList so I can show HBITMAPs in my list (just plain color rectangle). I want to be able to replace a color. For exemple, if I select some color in the list, then hit replace, the color shall be changed. I use the…
Papsicle
  • 147
  • 11
0
votes
2 answers

Loading and Converting a HBITMAP to an OpenGL Texture

I want to load a HBITMAP from a resource file and use it as an OpenGL texture. The code I use: HBITMAP hBmp = (HBITMAP) LoadImage(hInstance, MAKEINTRESOURCE(id), IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION); BITMAP BM; GetObject(hBmp,…
user3075425
  • 332
  • 1
  • 6
  • 23
0
votes
1 answer

How to convert Gdiplus::Bitmap* object into HBITMAP

I am using MFC, now i have a bitmap object, obtained by using: Gdiplus::Bitmap* bmp = Gdiplus::Bitmap::FromStream(pStream); How to convert this bmp object into HBITMAP? I used : HBITMAP hBitmap = NULL; bmp->GetHBITMAP(Color::White, &hBitmap); but…
Tiktac
  • 966
  • 1
  • 12
  • 32
0
votes
2 answers

Creating a HBITMAP from an existing buffer

I have an existing buffer full of (DIB) bitmap data, i.e. width x height x 4 bytes (RGBA) in size. What I want to do is draw this bitmap to the screen, but looking at the CreateBitmap... / CreateDIB... functions, they don't appear to do what I'm…
Mark Ingram
  • 71,849
  • 51
  • 176
  • 230
0
votes
1 answer

MFC HBITMAP memory leak does not go away

whenever I execute the below code, my memory in task manager for the application keeps on increasing endlessly. I found similiar questions here on stackoverflow and I did some DeleteObject calls like they stated but this still did not solve the ever…
skyzaDev
  • 108
  • 8
0
votes
1 answer

Winapi LoadBitmap() is not loading images from my resources

In my .rc file I have add line: IMG BITMAP "myIMG.bmp" //add to resources Prototype in .cpp file: HBITMAP Image; after ShowWindow() I load it in to memory with: Image=LoadBitmap(hInstance,"IMG"); On WM_CREATE: I load it on to the screen and…
NightKn8
  • 379
  • 6
  • 18
0
votes
2 answers

load or save bitmap handle win32 in C

Ultimately I want to save the Image from the clipboard to an img file(.bmp, JPEG whatever). That's a long road, so I just want to load the image into the window but I don't seem to have any succes with GetClipboardData(). It always returns NULL.…
kundrata
  • 651
  • 3
  • 12
  • 24
0
votes
1 answer

Convert HBITMAP to QImage without using QPixmap

I am extracting thumbnails of files from Windows in a secondary thread and the output is an HBITMAP. Now I got to convert this to QImage to send it back to the main thread. As you might already know, using QPixmap in non-gui threads results in…
Prad Lal
  • 113
  • 7
0
votes
1 answer

How to pass array of bitmaps from managed C++ to unmanaged C++

I currently have an array of System::Drawing::Bitmaps in a dll in managed C++ code. I would like to be able to call into the method in the managed C++ from unmanaged(native) C++. The question is how to do I pass the array back to unmanaged C++? I…