CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2001
    Posts
    8

    Question icons - concatenate in memory

    help - I need to concatenate multiple icons from the apps resource file into one wider icon that is created in memory and then displayed.

    the number of icons being concatenated varies and are of different images.

    hicon1 = LoadIcon(hInst,aIcon1);
    hicon2 = LoadIcon(hInst,aIcon2);
    hicon3 = LoadIcon(hInst,aIcon3);
    hicon4 = LoadIcon(hInst,aIcon4);
    hicon5 = LoadIcon(hInst,aIcon5);
    ...

    based on a selection i need to concatenate the icons to create hIconNew
    all icons are 16x16 in size.

    create new icon where hIconNew = hIcon1 + hIcon3 + hIcon4; (how icons will be displayed .. one after another).
    or
    another time i may need to display
    hIconNew = hIcon2+hIcon5;

    then with new icon handle call

    SendMessage(hWnd,SB_SETICON,0,(LPARAM)hIconNew);

    Does any one know how to do this??

    Thanks,
    Art

  2. #2
    Join Date
    Nov 2007
    Posts
    613

    Re: icons - concatenate in memory

    Load the icons.
    Create a memory DC and select in it a bitmap having the size of the concatenated image.
    Use DrawIcon to draw your icons in the memory DC at the desired positions.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured