GdiPlusX

IMPORTANT FIX

I think I finally caught one of the most challenging bugs we had in FoxyPreviewer, that made the reports render only the data from the first field in some reports that used Private DataSessions, and some other specific settings.

I received complaints from 4 people in the last year, but nobody could give me any clue about what was going on, or to help me to reproduce the problem. I finally found a good soul, Flavio Cardoso, from the brazilian VFP user group, who had the same issue, and provided the needed information, and worked with me during… Continue reading

hey guys,

thanks to Luis Maria Guayan and Guillermo Carrero from the spanish speaking community, now we have a brand new freeware and open source project for VFP.

Foxbarcode is a 100% visual foxpro class that provides a tool for generating images with different bar code symbologies to be used in vfp forms and reports, or exported to other applications.

 

you can learn more about the class foxbarcode and download freely from http://sites.google.com/site/foxbarcode
foxbarcode is still in beta, but it is 100% functional. the most important barcodes are already available, and they're already working on new ones.

instead of… Continue reading

After I posted a Gauge sample with gdiplusx some months ago, Rafael Lippert from Brazil adapted my original code and created this cool analog watch, using GdiplusX and the 'ImageCanvas' class:

LipsilClock

 

Cool isn't it ? it permits many customizations, and you may use it as a sample to learn other gdiplusx techniques.

You may get it directly from rafael' blog, at: http://rafaellippert.wordpress.com/2011/06/21/a-gdiplusx-analog-clock/

It's worth to spend some time in rafael's blog and website - www.lipsil.com.br . I'm sure you'll find some really very neat utilities.

Cropping an image is super simple using GdiplusX

Prerequisites
Visual FoxPro 9 and the GdiplusX library from VFPX 

Please make sure that you have the latest version, because this sample may be using some functions that were added or fixed recently.
http://www.codeplex.com/vfpx/wiki/view.aspx?title=gdiplusx&referringtitle=home

 

The cropping is done by the fuction "clone()" from the bitmap class. All we need is to pass a rectangle object containing the x, y, width and height of the desired image to be cropped.

Original image

Top Left

Center

Bottom Right

Run the code below, selecting any image, and you will see the… Continue reading

Below are 4 simple ways to convert a bmp to icon, using gdiplusx.
Those 2 blog posts were before we updated the library, adding the support for saving icons with good quality.

This sample uses 4 techniques, and creates 4 versions of icons from the same image file.
Before the conversion, it resizes the source image to the size of 16x16. this means that with this sample you can convert any image to ico file.

In the next release, we hope to deliver a complete solution for .ico files too, with very simplified code, offering great ico files support, that… Continue reading

Here are some notes on bmp transparencies on vfp, based in some conclusions I took after some discussions in Foxite, specially the ones with Bernard Bout.

BMP image files, when used in the picture property of the image control usually show whites - rgb(255,255,255) as transparent. VFP creates a temporary mask for our pictures in order to show this way.

picture 1: bmps can have whites converted to transparent when using the "picture" property and backstyle set to "transparent".

 

But this works only for the 'Picture' property, not for 'PictureVal' !

The code below creates a simple image… Continue reading

That's a very easy task for Gdiplus-X:

important:

All samples below use the Gdiplus-x library. Get the latest stable release from codeplex:

http://www.codeplex.com/wiki/view.aspx?projectname=vfpx&title=gdiplusx

do locfile("system.app")

with _screen.system.drawing

   local mybitmap as xfcbitmap
   && create a bitmap object
   mybitmap = .bitmap.new(getpict())

   && save the bitmap in different formats
   mybitmap.save("c:\mypng.png", .imaging.imageformat.png)
   mybitmap.
save("c:\mybmp.bmp", .imaging.imageformat.bmp)
   mybitmap.
save("c:\mytiff.tif", .imaging.imageformat.tiff)
   mybitmap.
save("c:\myjpeg.jpg", .imaging.imageformat.jpeg)
   mybitmap.
save("c:\mygif.gif", .imaging.imageformat.gif)

endwith

Of course, you can save as jpeg… Continue reading

Some types of files allow to store various icons together with other binary data, such as exes and dlls. .ICO files also allow to store more than one icon in a single file. Windows uses this a lot, and stores almost all the icons that it uses all the time in some dll or exe libraries.

The GdiplusX library can easily extract these icons, using the function “ExtractAssociatedIcon” from the xfcIcon class, as follows:

important:

All samples below use the Gdiplus-X library from VFP-X project. Download the latest stable release from codeplex:

http://www.codeplex.com/wiki/view.aspx?projectname=vfpx&title=gdiplusx

 

 

* the following… Continue reading

After some requests, i'm sending a new version of gpimage2, an adapted class from the original GpImage class from alexander golovlev.

This new version adds 3 new features to the previous version:
control smoothing mode, interpolation mode and a gradient brush.

Gdi+ originally offers 6 kinds of linear gradient brushes, and many possibilities for path gradient brushes, but to update Gpimage2 is not a priority any more because I think that the GdiplusX library brings much more value, and is compatible with the .NET "system.drawing" namespace.

So, if you still didn't upgrade to VFP9, you can download this new … Continue reading

Some days ago I posted a solution based on Alexander Golovlev's GpImage Gdi+ class showing how to send an image to the clipboard.

We agreed that although this function is not present originally on the "system.drawing" namespace from .net, it could represent a good addiction to the gdiplus-x livrary for vfp. so, the function "toClipboard()" was added to the bitmap class.

From now on, I mean from gdiplus-X release 0.07 and forward, we can send any Gdi+ compatible image to the clipboard using the new "toClipboard()" function just added to the bitmap class using the simple… Continue reading