Results 1 to 21 of 21

Thread: StretchBlt

  1. #1

    Thread Starter
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181

    StretchBlt

    hey Everyone
    I know this has been posted before, but I could not find it on the search (wierd...)
    so could anyone pls tell me what I need to do in order not to get the ugly colorproblems and artifacts or whatever when using strechtblt? there was an alternative right??
    thanks
    Sanity is a full time job

    Puh das war harter Stoff!

  2. #2
    Crunchy Cat
    Guest
    Hi, the function just copies one DC to another. If you are running
    into color problems maybe its the way the source DC was drawn?
    If you used a function like StretchDIBits () I know the
    'BITMAPINFO' parameter has to be passed in as a pure byte
    array; otherwise, it's 'RGBQUAD' member may be at a different
    address and cause color problems during a blit operation. Of
    course I could be way off on my understanding of what you
    are trying to accomplish

    -CC

  3. #3

    Thread Starter
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    well I solved my problem some sloppy way already...
    well I just used StretchBlt... (If I would have had time I would have done it a cleaner way... oh well)
    strangely enough it screws up when I make pictures smaller they start looking crappy.... I just blt from one picbox to another
    I thought I could get that problem fixed with StretchDiBits, while skimming through the registry I saw something like it wont support w95... bad enough I did that little program for someone using w95... oh well I hope it works...

    the controls do support jpg in w95 though right???????
    Sanity is a full time job

    Puh das war harter Stoff!

  4. #4
    Crunchy Cat
    Guest
    Yep, they do support win95 (for VB6). for VB.Net, I am not sure...
    I heard a rumor that MS no longer supports 95 with their
    software (and .Net would be within that decision time frame).

    -CC

  5. #5

    Thread Starter
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    yeah well but does vb support the jpeg under w95 (I know it should, but the rumor you were talking about is pretty true..)

    I really don't understand why microsoft does that (i.e DirectX8 does not work on 95 anymore... you can't tell me architecture is to different from w98...)

    thanks for the help!
    Sanity is a full time job

    Puh das war harter Stoff!

  6. #6
    PowerPoster Arbiter's Avatar
    Join Date
    Sep 2000
    Location
    Manchester
    Posts
    2,276
    Originally posted by /\/\isanThr0p
    well I solved my problem some sloppy way already...
    well I just used StretchBlt... (If I would have had time I would have done it a cleaner way... oh well)
    strangely enough it screws up when I make pictures smaller they start looking crappy.... I just blt from one picbox to another
    I thought I could get that problem fixed with StretchDiBits, while skimming through the registry I saw something like it wont support w95... bad enough I did that little program for someone using w95... oh well I hope it works...

    the controls do support jpg in w95 though right???????
    Misanthrop,

    I too have the same problem with StretchBlt when scaling images down.

    Could you please tell me how you got around it and also the cleaner way you would have used?

    If you can help me fix this, I'll love you forever!!!
    Gentile or Jew,
    O you who turn the wheel and look to windward,
    Consider Phlebas, who was once handsome and tall as you...

  7. #7

    Thread Starter
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    Hey Arbiter.
    Even though the prize is high I can't help you... (as of now)
    the way I used you really don't want to know it is so sloppy programming that I feel ashame of it
    well if you really wanna know I used the image control set the stretch property to true and well you can figure the rest....

    but what exactly do you need? I might be able to help you. Does it need to be as fast as StretchBlt or would something little slower work for you too?
    Sanity is a full time job

    Puh das war harter Stoff!

  8. #8
    PowerPoster Arbiter's Avatar
    Join Date
    Sep 2000
    Location
    Manchester
    Posts
    2,276
    Though it pains me to do so, I'll have a whizz with the image control and see if I can get some decent speed out of it.

    If you have any other suggestions though, I'm all ears...
    Gentile or Jew,
    O you who turn the wheel and look to windward,
    Consider Phlebas, who was once handsome and tall as you...

  9. #9

    Thread Starter
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    well as of right now It does not work for me, but I still think it might work for you... to bad I can't take credit for it anyways (maybe you could still love me if it works )
    take a look at the high quality image resizing at www.ur.co.nz
    Sanity is a full time job

    Puh das war harter Stoff!

  10. #10
    PowerPoster Arbiter's Avatar
    Join Date
    Sep 2000
    Location
    Manchester
    Posts
    2,276
    Umm.... I'm struggling with this image control thing.

    It's probably only something dead simple. I've moved the graphic to the image control with the stretch set to true, so it's shrank it.

    Beautiful.

    Now, how do I get it out again at that size? If I reference its picture property it pulls it out at its full size, same if I save it.

    Any ideas?
    Gentile or Jew,
    O you who turn the wheel and look to windward,
    Consider Phlebas, who was once handsome and tall as you...

  11. #11

    Thread Starter
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    I will take a look
    Sanity is a full time job

    Puh das war harter Stoff!

  12. #12

    Thread Starter
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    haha you wont believe it but the paintpicture method does it all without any flaws love me now?
    Sanity is a full time job

    Puh das war harter Stoff!

  13. #13
    PowerPoster Arbiter's Avatar
    Join Date
    Sep 2000
    Location
    Manchester
    Posts
    2,276
    That depends.

    I've just spent the last 3 hours writing a linear resizing function, and now you tell me that paintpicture solves all my problems.

    PAINTPICTURE!!!!!

    DAMNIT ALL TO HELL AND BACK ON A BOAT!!!

    *ahem*

    I'd totally forgotten about paintpicture.

    I'll have a play and post back.

    Thanks pal!
    Gentile or Jew,
    O you who turn the wheel and look to windward,
    Consider Phlebas, who was once handsome and tall as you...

  14. #14
    PowerPoster Arbiter's Avatar
    Join Date
    Sep 2000
    Location
    Manchester
    Posts
    2,276
    Misanthrop....

    You DA MAN!!!

    I've conned it into working with the image box now and the graphics resize beautifully. Sure, I won't win any awards for sexy programming but hey - bollocks!

    Thanks for your help there, I've been struggling with that for a while and had no idea it would have such a simple solution.

    I'd marry you and have your children if I were physically capable of childbirth!

    Thanks!
    Gentile or Jew,
    O you who turn the wheel and look to windward,
    Consider Phlebas, who was once handsome and tall as you...

  15. #15

    Thread Starter
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    LOL
    well happy that I could give you the needed idea...
    and hey it's one line of code so it at least does look like good programming might not be the most efficient way though but oh well
    Sanity is a full time job

    Puh das war harter Stoff!

  16. #16
    PowerPoster Arbiter's Avatar
    Join Date
    Sep 2000
    Location
    Manchester
    Posts
    2,276
    Misanthrop...

    If you want to see where the resize is being used then download the latest version of Sentience....

    http://www.vbforums.com/showthread.p...097#post949097

    (blatant plug).

    The RMV underneath the headquarters is the resized version, right click on it and click show mech (or whatever) and you'll see the full size version.

    Thanks again for your help..
    Gentile or Jew,
    O you who turn the wheel and look to windward,
    Consider Phlebas, who was once handsome and tall as you...

  17. #17

    Thread Starter
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    well I am happy that I could help you, but I am not sure if I am gonna take a look at sentience right now... I haven't played any turn based strategy game except for fallen haven and if you know that one you know that it does not have any complexity...
    well I will take a look in time
    Sanity is a full time job

    Puh das war harter Stoff!

  18. #18
    PowerPoster Arbiter's Avatar
    Join Date
    Sep 2000
    Location
    Manchester
    Posts
    2,276
    Take a look whenever you like. There's no great rush.

    You're just missing out on the best VB game in the world ever...
    Gentile or Jew,
    O you who turn the wheel and look to windward,
    Consider Phlebas, who was once handsome and tall as you...

  19. #19

    Thread Starter
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    well I haven't seen many games except for sentience that really had something more compelling than just a great concept (normaly someone else already came up with years ago) like tetris and snake (hey I made a great snake game !!). I mean those games are cool, but everyone could make those. Do you know of any other big game projects done in VB?
    Sanity is a full time job

    Puh das war harter Stoff!

  20. #20
    PowerPoster Arbiter's Avatar
    Join Date
    Sep 2000
    Location
    Manchester
    Posts
    2,276
    Not really.

    There the Times Of War project going on, but the bulk of that appears to be in C++.

    I don't think many people have the guts to try and write a full game in VB....
    Gentile or Jew,
    O you who turn the wheel and look to windward,
    Consider Phlebas, who was once handsome and tall as you...

  21. #21

    Thread Starter
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    I think it's because of the slow string and array operations and the lack of inheritance...
    Still I think it can be done in VB. As of right now, I don't have the time to dive that deep into vb... I am just doing tiny things like my little CD-database and even tinier tools for single use pretty much...
    After this year I am thinking about starting something. I will have about 4 month that I will be able to spend lots of time, than I will have my finals so I wont have any time for about 3 month and than there is going to be about 1.5 years of time I could use... so I got to start planning and getting skills..
    Sanity is a full time job

    Puh das war harter Stoff!

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