Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. GDI+ problemos

GDI+ problemos

Scheduled Pinned Locked Moved C / C++ / MFC
graphicswinformsdata-structurestutorialquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Tim Stubbs
    wrote on last edited by
    #1

    Consider the following (i've cut things for brevity)... using namespace Gdiplus; CImageList img; img.Create(IDB_USERBUTTONS,32, 52, RGB(192,192,192)); CLSID bmpClsid; if (GetEncoderClsid(L"image/bmp", &bmpClsid) == -1) { ASSERT(FALSE); } IMAGEINFO *i; for (long t = 0; t < numbuttons; t++) { HICON bibi = ImageList_img.ExtractIcon(t); HICON bibi2 = CopyIcon(bibi); Bitmap image(btn.GetIcon()); s = image.Save(name.AllocSysString(), &bmpClsid, NULL); } So, in effect, I'm trying to use the Bitmap class' constructor to load an image from a HICON which itself derives from an ImageList (ExtractIcon). However, although this should work (and i can use the HICON on a button for example) the Bitmap constructor simply blows up, trashes the stack and leaves me with nothing useful to work with. Passing a HICON from an icon resource... works. Why? It seemed like a fine idea to parse an imagelist into a bunch of disk-based image files... :wtf: Tim Stubbs

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups