CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: Picture control

  1. #1
    Join Date
    Sep 2003
    Location
    Argentina....
    Posts
    118

    Picture control

    Hi,
    i'm trying to use an picture control, but i couldn't open a bitmap from an especified folder without include it in the resource view...

    Thanks in advance,
    Diego
    My history: QB->VB->TC++->VB->VC++->VC#

  2. #2
    Join Date
    Nov 2003
    Location
    Central Florida
    Posts
    44
    To use bitmaps at design time, you have to include all bitmaps in your resource file, because of how Windows .EXEs work. If you want to load the bitmap at runtime, look into the GDI+ library, specifically the Image class and the Image::FromFile function, which loads a picture from a file via code rather than loading from a resource.
    But... but... I'll set the building on fire.

    How many keys do YOU press?

  3. #3
    Join Date
    Nov 2002
    Location
    Los Angeles, California
    Posts
    3,863
    Or look at the ::LoadImage function
    Wakeup in the morning and kick the day in the teeth!! Or something like that.

    "i don't want to write leak free code or most efficient code, like others traditional (so called expert) coders do."

  4. #4
    Join Date
    Nov 2003
    Location
    Central Florida
    Posts
    44
    Originally posted by souldog
    Or look at the ::LoadImage function

    Yes, but ::LoadImage only applies to bitmaps which are already in the app's resource table.
    But... but... I'll set the building on fire.

    How many keys do YOU press?

  5. #5
    Join Date
    Sep 2002
    Location
    14° 39'19.65"N / 121° 1'44.34"E
    Posts
    9,815
    Originally posted by Apoch
    Yes, but ::LoadImage only applies to bitmaps which are already in the app's resource table.
    No, by using the LR_LOADFROMFILE flag, ::LoadImage() will load bitmaps from files.

  6. #6
    Join Date
    Nov 2003
    Location
    Central Florida
    Posts
    44
    Originally posted by gstercken
    No, by using the LR_LOADFROMFILE flag, ::LoadImage() will load bitmaps from files.

    Interesting... learn something new every day
    But... but... I'll set the building on fire.

    How many keys do YOU press?

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