Foxite.COM Community Weblog

Foxite.COM Community Weblog - free weblog service for the Visual FoxPro Community.
Welcome to Foxite.COM Community Weblog Sign in | Join | Help
in
Home Blogs Forum Photos Forum Archives

VFP IMAGING



ROTATE / FLIP IMAGES WITH VFP9 AND GDI+

Rotating and / or flipping images is a simple task for Gdi+. To see the different results possible, change the constant value in the parameter "RotateFlip" in the code below.
 
*-- RotateFlipType Constants
#define RotateNoneFlipNone 0
#define Rotate90FlipNone   1
#define Rotate180FlipNone  2
#define Rotate270FlipNone  3
#define RotateNoneFlipX    4
#define Rotate90FlipX      5
#define Rotate180FlipX     6
#define Rotate270FlipX     7
 
LOCAL lcSource, lcDestination
lcSource = GETPICT("jpg;gif;bmp")
 
LOCAL loImage AS GpImage OF ffc/_gdiplus.vcx
loImage = NEWOBJECT("GpImage",HOME()+"ffc/_gdiplus.vcx")
loImage.CreateFromFile(lcSource)
loImage.RotateFlip(Rotate180FlipNone) && Try changing using the constants above
loImage.SaveToFile("flipped.png","image/png")

RUN /N explorer.EXE flipped.png

 

RotateNoneFlipNone 0 

Rotate90FlipNone   1 

Rotate180FlipNone  2 

Rotate270FlipNone  3 

RotateNoneFlipX    4 

Rotate90FlipX      5 

Rotate180FlipX     6 

Rotate270FlipX     7 

 

See also this blog post:

Use encoder parameters to save your images with GDI+

 

Published Tuesday, February 07, 2006 4:29 PM by cesarchalom
Filed Under:

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

Ana María Bisbé said:

Versión en Español de este artículo in / Spanish version at http://www.portalfox.com/article.php?sid=2181
July 24, 2007 12:16 AM
 

foxpro.catalyst ?? » Blog Archive » More VFP9 and GDIs said:

October 8, 2007 10:11 PM

What do you think?

(required) 
(optional)
(required)