+ Reply to Thread
Results 1 to 2 of 2

Thread: How to load bitmap dynamically in CBitmap object?

  1. #1
    Junior Member
    Join Date
    May 2012
    Posts
    23

    How to load bitmap dynamically in CBitmap object?

    I am working on a MFC project.

    I want to load jpg/png and other images dynamically in CBitmap object.

    How can I do this in MFC?

    Please provide some ideas on it.

    Thanks.

  2. #2
    Junior Member
    Join Date
    Jun 2012
    Posts
    24
    Try below code fragment:

    Code:
            CImage objImage ;
    	objImage.Load(_T("C:\\MyPictures\Image.jpg")) ;
    	CBitmap objBitmap ;
    	objBitmap.Attach(objImage.Detach()) ;

+ Reply to Thread

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts