15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


Wrapping a HBITMAP with CBitmap

Dan Edwards -- dedwards@silvercrk.com
Sunday, November 10, 1996


 Environment: Win95,WinNT,  VC++ 4.2b

I need to take a HBITMAP and create a CBitmap off of it. CBitmap has a
function called FromHandle which takes as a param HBITMAP and returns a
CBitmap*, but the class it returns is a temporary gdi object, which the
frame work destroys on the next idle time. I would like it to stick around
a little longer then that. The only solution I've come up with is to blit
the contents of the temporary one into a new CBitmap. Which is just plain
silly... And why doesn't MFC use more copy constructors???

Thanks for any help
Dan




Brad Wilson/Crucial Software -- crucial@pobox.com
Sunday, November 10, 1996

> I need to take a HBITMAP and create a CBitmap off of it.

CGdiObject :: Attach()

> And why doesn't MFC use more copy constructors???

Such as... ?

--
Brad Wilson             | crucial@pobox.com         http://www.thebrads.com
Objectivist Philosopher | "Take the time, reevaluate,
Software Engineer       |  It's time to pick up the pieces
Web Page Designer       |  Go back to square one
System Administrator    |  I think it's time for a change"  - Dream Theater




SachinX Keskar -- SachinX_Keskar@ccm.jf.intel.com
Monday, November 11, 1996


Text item: 

Use CBitmaps FromHandle function to have a CBitmap from HBITMAP

Sachin


> I need to take a HBITMAP and create a CBitmap off of it.

CGdiObject :: Attach()

> And why doesn't MFC use more copy constructors???

Such as... ?

--
Brad Wilson             | crucial@pobox.com         http://www.thebrads.com
Objectivist Philosopher | "Take the time, reevaluate,
Software Engineer       |  It's time to pick up the pieces
Web Page Designer       |  Go back to square one
System Administrator    |  I think it's time for a change"  - Dream Theater

Text item: External Message Header

The following mail header is for administrative use
and may be ignored unless there are problems.

***IF THERE ARE PROBLEMS SAVE THESE HEADERS***.

Reply-To: mfc-l@netcom.com
Precedence: bulk
Errors-To: owner-mfc-l@majordomo.netcom.com
Sender: owner-mfc-l@majordomo.netcom.com
Message-ID: <19961110201109912.AAA200@ragnar>




| Вернуться в корень Архива |