Results 1 to 2 of 2

Thread: Reverse an image in a byte array???

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 2000
    Location
    England. Northants
    Posts
    21

    Reverse an image in a byte array???

    Please can anyone help. I have an image/pic in
    a byte array and cannot figure out how to reverse the pic.
    Main Problem: I need to take an existing (upright) picture/image
    and then display it in a picbox upside down.
    I've put the pic in a byte array & tried to reverse
    the bytes - i.e. last byte into first position etc...
    No luck. Please can anyone advise.... Katz
    Val

  2. #2
    Lively Member
    Join Date
    Nov 2001
    Location
    i live where you don't
    Posts
    76
    something like this should work (btw, i don't have vb on this computer so i can't test this):

    for y = 0 to picture1.height
    for x = 0 to picture1.width
    c = picture1.point(x,y)
    picture2.pset(picture2.height-y,picture2.width-x),c
    next
    next




    well, this isn't very efficient or practical because it's so slow. you could replace the pset and point calls with api functions.

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