I want to be able to take a flat image and do this with it in my program:
I think I know a logical way of doing it but don't know how to..
- create abitmap as bitmap
- load image into abitmap (in this example image is 60px width x 40px height)
- make new bbitmap as bitmap
- bbitmap is created to a size for example 10px x 40px
- load left section of abitmap into bbitmap so in affect now split the image into two
- change top-right and bottom-right points to lower and higher respectively on abitmap
- change top-left and bottom-left points to lower and higher respectively
- create finalbitmap as bitmap
- draw abitmap and bbitmap on finalbitmap to put them together and make one 3D image
- now use the .mypen tool to draw the line where abitmap and bbitmap ajoins
But..
how do I change the points?
how do I load only PART of an image from abitmap into bbitmap?
an image is always rectangular, although you can make part of it transparent. you could recreate that effect with the picturebox's region property + draw the white lines on the fininshed image.
You are looking at doing this in an easy way. That may not be possible, and even if it is, it might not be ideal. One alternative would be to draw a mesh and texturemap the image onto the mesh. That would be 3D graphics, probably using DirectX....and that's as far as I know, cause I suck at graphics. Still, that is how people make things like spinning cubes with images on them, objects in 3D games (where the object is VASTLY more complex than a simple cube), and so forth. It's a whole different area, though.
gr.FillPolygon(Brushes.White, New PointF() {New PointF(0, 0), New PointF(img.Width - 1, 0), New PointF(img.Width - 1, 60), New PointF(29, 10), New PointF(0, 37)})
gr.FillPolygon(Brushes.Magenta, New PointF() {New PointF(0, 0), New PointF(img.Width - 1, 0), New PointF(img.Width - 1, 55), New PointF(29, 5), New PointF(0, 32)})
gr.FillPolygon(Brushes.White, New PointF() {New PointF(0, img.Height - 1), New PointF(img.Width - 1, img.Height - 1), New PointF(img.Width - 1, img.Height - 46), New PointF(29, img.Height - 11), New PointF(0, img.Height - 26)})
gr.FillPolygon(Brushes.Magenta, New PointF() {New PointF(0, img.Height - 1), New PointF(img.Width - 1, img.Height - 1), New PointF(img.Width - 1, img.Height - 41), New PointF(29, img.Height - 6), New PointF(0, img.Height - 21)})
as shaggy said there are better ways of doing this. my effort is just a 3d illusion
Illusions can be better than reality if they are suitable. I remember reading in a graphics book about the final space battle in the third installment of the first Star Wars trilogy (was that Return of the Jedi?). The battle was some big free for all around the partially completed death star. Apparently, if you freeze one of the scenes and look at all the ships, one of them looks like a sneaker....because it IS a sneaker. People don't generally notice that while watching the movie, because they see what they expect to see.