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

    Transform and Image

    I am trying to transform and image from a square into a triangle is there away to do this?

    Thank you,
    Jeremy H.


  2. #2
    Join Date
    Feb 2000
    Location
    South Carolina, US
    Posts
    36

    Re: Transform and Image

    Probably no built in way, wut with some or other formula and a 3-D array (width*height*3) you should be able to do it. The 3 at the end is for Red, Green and Blue. Use the formula to copy froma rectangular image to the parts of the array yo u want to draw to. Each cell of the triangle contains the average of the color values squeezed over it. For the standard equilateral the top row would have the average of all top pixels of the source square, the and bottom row of the triangle and the bottom row of the square would be identical. Just play with it until it works. You could also try dropping pixels to make it fit instead.


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