Questions tagged [cbitmap]

27 questions
0
votes
1 answer

Create CBitmap from CDC?

Using C++/MFC and GDI (not GDI+), the overall goal is to create an patterned HBRUSH, which will be used in OnCtlColor to outline an edit control in red, with the ability to turn the outline on and off. To do this, you attach a bitmap to an HBRUSH…
Woody20
  • 791
  • 11
  • 30
0
votes
2 answers

Improving the grey scale conversion result

Here is the colour menu: Here is the same menu with some of the menu items disabled, and the bitmaps set as greyscale: The code that converts to grey scale: auto col = GetRValue(pixel) * 0.299 + GetGValue(pixel) * 0.587 + …
Andrew Truckle
  • 17,769
  • 16
  • 66
  • 164
0
votes
1 answer

how to convert CBitmap to cv::Mat?

How to convert CBitmap to cv::Mat? Maybe there are some libs or something else... like... CBitmap bitmap; bitmap.CreateBitmap(128, 128, 1, 24, someData); cv::Mat outBitmap(128,128,someData,1,24); but that code is incorrect. thanks!
0
votes
1 answer

Avoid re-loading images during scrolling

I am building a MFC 2008 mdi application which displays images. When i scroll all the images must be re-loaded. I am tring to avoid this by saving the CPngImage and CBitmap files the first time through, then re-use them subsequently. The statement…
0
votes
1 answer

how to get and manipulate CBitmap information

I am a total newbie to c++ and non the less MFC so bare with my questions please.. i have been using MatLab throughout college to do image processing HERE IS THE QUESTION: I have already read a .bmp image and stored it into a CBitmap object, but i…
Mohab Mesherf
  • 13
  • 1
  • 9
0
votes
1 answer

Create a CBitmap from Resources ID

I need to fill a CImageList with a number of bitmaps which are stored in separate bmp files (rather than as a single bmp with numerous parts). I assume I need to create a CBitmap so I can call the Add method of CImageList. So how might one create a…
Smashery
  • 57,848
  • 30
  • 97
  • 128
0
votes
1 answer

How to Add PNG Image as Button Image in CMFCToolBar?

Seems like CMFCToolBar Allowing only BITMAP Images ( which are of color depth 24 ) to place on Buttons. How to get rid of this limitation. i am neither able to place a PNG nor a bit map with color depth 32 (alpha channel included). i tried attaching…
0
votes
1 answer

Does MemoryDC occupied memory or the memory on video card?

I am using the following code to create a compatible DC: m_pDC=new CDC(); VERIFY(m_pDC->CreateCompatibleDC(sampleDC); CBitmap bitmap; if (bitmap.CreateCompatibleBitmap(sampleDC, rect.Width(), rect.Height())) { m_pOldBitmap =…
user25749
  • 4,825
  • 14
  • 61
  • 83
0
votes
2 answers

CreateCompatibleBitmap Vs SelectObject

I'm wondering , if I want to create different bitmaps, I use the CreateCompatibleBitmap function again and again, to associate it to the same memory CDC. is it the same meaning that I CreateBitmap and SelectObject again and again?? I ask this…
Steven Shih
  • 645
  • 1
  • 10
  • 22
0
votes
1 answer

Can I attach a CBitmapButton to a parent CWnd, instead of a parent CDialog?

I have inherited a project (originally written for Win95!) which has a number of buttons attached to a parent window derived from CWnd. The buttons themselves are in a user-defined class derived from CWnd, so they are not "real" buttons, but little…
Ken
  • 369
  • 3
  • 15
0
votes
1 answer

CBitmap::GetBitmap Failure

What could be the possible reasons of getting return code as 0 from GetBitmap()? BITMAP bmInfo; int rc = bitmap->GetBitmap (&bmInfo); int ec = GetLastError(); The value returned by GetLastError() is also 0. MSDN doesn't give any help and all the…
Jaywalker
  • 3,079
  • 3
  • 28
  • 44
-1
votes
1 answer

mfc load image into imagelist for tree control

Please help! I have tried loading image to image list via icon, hbitmap and cbitmap (i am using mfc dialog based application). But the images just wont show up. But I managed to view the image when i recreate it on an empty sdi mfc application. …
Ardy Wong
  • 3
  • 2
1
2