Thread: [C] change picture width and height in Static control (no MFC)

  1. #1
    Registered User
    Join Date
    Apr 2008

    [C] change picture width and height in Static control (no MFC)


    we are using Visual C++ 6.0.
    we are making a Win32 program with a Dialog Box (resource). in the Resource Editor, we added a picture in this Dialog Box, which is a Static control, named IDC_STATIC.
    the problem is that, everytime we add a picture - icon file, BMP - in the dialog box, the resource editor doesn't let us resize it, if not by changing the size of the actual picture file.
    the question is: by code, how can we resize a Static control that contains a picture?

    thank you in advance.

  2. #2
    train spotter
    Join Date
    Aug 2001
    near a computer
    If I recall correctly, no. Resizing the static will crop the image or leave blank areas.

    I load the image into a memory DC and redraw the image (in WM_PAINT) as required using StretchBlt().


    I change the size of the actual image before adding to the control.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. get keyboard and mouse events
    By ratte in forum Linux Programming
    Replies: 10
    Last Post: 11-17-2007, 05:42 PM
  2. Button handler
    By Nephiroth in forum Windows Programming
    Replies: 8
    Last Post: 03-12-2006, 06:23 AM
  3. A bunch of Linker Errors...
    By Junior89 in forum Windows Programming
    Replies: 4
    Last Post: 01-06-2006, 02:59 PM
  4. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM
  5. Outputting String arrays in windows
    By Xterria in forum Game Programming
    Replies: 11
    Last Post: 11-13-2001, 07:35 PM