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



Helper code to create image on the fly for "Using the Alpha Channel in Visual Foxpro Images" from Bernard Bout

Here's another very simple code that attends Bernard Bout, creating an image on the fly, based on his post entitled "Using the Alpha Channel in Visual Foxpro Images". Again in this sample, I'm using the new GdiPlus-X classes from VFP-X project that can be downloaded from here: http://www.codeplex.com/Wiki/View.aspx?ProjectName=VFPX&title=GDIPlusX

Hope this helps Bernard !

Target Image: MainForm.png

* Helper code to create image on the fly for
* Bernard Bout "Using the Alpha Channel in Visual Foxpro Images"
*
http://weblogs.foxite.com/bernardbout/archive/2006/09/11/2436.aspx
*    Image Dimensions 300 x 270 pixels
*    Make all image totally transparent
*    Draw a light yellow - RGB(254,254,228) rectangle
*         centered in the main image.
*    Save as PNG, to preserve the transparencies

DO LOCFILE("System.App")

WITH _SCREEN.System.Drawing

* Create an empty bitmap
LOCAL loBitmap AS xfcBitmap
loBitmap = .Bitmap.New(300,270)

* Initialize the graphics object
LOCAL loGfx AS xfcGraphics
loGfx = .Graphics.FromImage(loBitmap)

* Make all image transparent
loGfx.Clear(.Color.FromARGB(0,0,0,0))

* Draw the yellow rectangle
loGfx.FillRectangle(.SolidBrush.New(.Color.FromRGB(254,254,228)), 10,9,278,249)

* Save as PNG to keep transparencies
loBitmap.Save("c:\BernardBoutAgain.png", .Imaging.ImageFormat.Png)

ENDWITH

RETURN

Published Tuesday, September 12, 2006 4:40 AM 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

 

Bernard Bout : Using the Alpha Channel in Visual Foxpro Images said:

September 12, 2006 3:53 PM
 

Binod Binani said:

New to VFP

I m using presently VFP6. Is it possible to change BUTTON Colors/Pictures
in VFP6

PLEASE PLASESESESESESESE!!!!!

Yes, There are some workarounds.

Check at www.news2news.com for an interesting aproach.

February 5, 2007 3:42 PM
 

Ana María Bisbé said:

Versión en Español de este artículo en / Spanish version at http://www.portalfox.com/article.php?sid=2263
July 24, 2007 7:09 PM

What do you think?

(required) 
(optional)
(required)