Results 1 to 3 of 3

Thread: How to scale a bitmap

  1. #1

    Thread Starter
    Addicted Member wolfofthenorth's Avatar
    Join Date
    Jan 2001
    Location
    Tatooine
    Posts
    169

    Smile

    Hi all,

    How do you scale a bitmap without using a picture box or image control? Is it done with StretchBlt or SetViewportExtEx?

    I have tried stretchblt and am having a problem... if the source and destination DCs have different width & height settings it is blank (even if it is off by one). If the settings are the exactly the same it works, but wont stretch.

    Ex. if these were in the appropriate areas of stretchblt it is blank for me.

    lwidth +1, lheight + 1,,, lwidth, lheight


    So i have two questions.
    1. does anyone have an idea about what is going on with my stretchblt?

    2. What is the best way to scale a bitmap without the help of a control?


    Thanks for any help you can give.

    wolf

  2. #2
    Lively Member TB's Avatar
    Join Date
    Feb 2001
    Location
    Austria
    Posts
    106
    I don't exactly know, but I have to refresh the PictureBox after I used the BitBlt call, maybe you have also to do this.
    mojo

  3. #3

    Thread Starter
    Addicted Member wolfofthenorth's Avatar
    Join Date
    Jan 2001
    Location
    Tatooine
    Posts
    169

    Question

    Thanks for the responce. I do appreciate the advice.

    There have been some developments. I fixed the problem but dont know why.

    I have loaded a iPictureDisp with a bitmap, and created a compatable dc to select it into; there must be something with the scale it uses, because if i divide its x & y by 29 or higher i can see it (bigger or smaller depending on the how high the number is.) I know that 15 is typiccaly twips per pixel, but what is 29?

    Thanks for the help.

    wolf

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