CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2001
    Posts
    8

    How can I tilt a image..

    I wan to tilt a image..

    ************
    ************
    ****image***
    ************
    ************

    ...tilt...

    ......../***********/
    ....../***********/
    ..../***image***/
    ../***********/
    /***********/

    tilting angle was given.

    I can use APIs ( bitblt, stretchblt, etc...) but I dont know the mehtod...

    pleas, someone help me...



  2. #2
    Join Date
    Jan 2000
    Location
    Olen, Belgium
    Posts
    2,477

    Re: How can I tilt a image..

    There's and example at http://www.planetsourcecode.com, but it involves you having to paint every pixel at it's new location, which is very slow.

    Tom Cannaerts
    [email protected]

    Programming today is a race between software engineers striving to build bigger and better idot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
    Tom Cannaerts
    email: [email protected]
    www.tom.be (dutch site)

  3. #3
    Join Date
    Mar 1999
    Location
    Nepal
    Posts
    540

    Re: How can I tilt a image..


    angle = 30 * 3.14 / 180
    slope = Tan(angle)
    for j = 0 to Picture1.ScaleHeight
    i = (Picture1.ScaleHeight - j) * slope
    BitBlt Picture2.hDC, i, j, Picture1.ScaleWidth, 1, Picture1.hDC, 0, j, vbSrcCopy
    next
    Picture2.Refresh





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