2014-11-25

GdiPlusX v1.21

Our last OFFICIAL published version is v1.20, at CodePlex.

Recently I noticed that some very well known Foxers have published in CodePlex some fixes and patches for GdiPlusX. In most cases, the bugs are very simple, some variables that have not been defined, some API calls with a missing parameter, and small typos, like using "tnWidth" instead of "lnWidth". None of these fixes change the way the library was coded, or its structure. An API was declaring an INTEGER parameter, when the correct would be to use a STRING.

No new properties were introduced, nothing. I've been applying and testing them all, and all sounds good. In fact, these bugs appeared in methods that I did not test before wide smile

The fixes come from: Christian Ehlscheidt, Doug Hennig, Rick Schummer, Martina Jindrova, MReigler, Daveaswj and me.

I've also included one single method in "xfcBitmap", that uses the API "ExtFloodFill", that resides in GDI32 (not Gdi+), and allows us to make fills in images. You tell the API the coordinates and the color to be used, and it fills the image till it finds a different color from the original. Very fast and cool! Me and Yosfi discussed about this API usage last month here at Foxite.



Another thing...

In the last version, we forgot to release the "samples" project, so people only had the SYSTEM.APP, and the samples project was somehow "hidden" at the old archives. New users could have difficulties with the library because of that.


So, I am preparing the release 2 distinct files:

1 - GdiPlusX v1.21 with the fixes above and the new function for "FloodFill".
2 - An updated "Samples" project, adding some few samples (4 or 5) using these new fixes and functions

VERY IMPORTANT:

This is not an official release !!!

This version is for testing purposes only.
I've submitted these files to Bo Durban, that is the project owner and manager. He is the person to decide to move it to production and to give the final words regarding it.

So, this is just for testing, ok? Or if you want to play with the samples, there are 2 that I think are realy very cool, the last in the list, one that uses the new "FloodFill" function and another that uses the "MeasureCharacterRanges" functions. I like specially the last sample, "MeasureCharacterRanges.scx". 
See at the image below why:



In summary, the "MeasureCharacterRanges" functions allow us to obtain VERY PRECISE measuring of strings, and getting the precise coordinates where each part of the text was rendered in the bitmap. Special thanks to Christian Ehlscheidt, the same author of VFP2C32 library from VFPX for the fixes in the functions related.
I've already updated VFPPaint to benefit from the new "FloodFill" function, and hope to publish it very soon.

http://vfpx.codeplex.com/releases/view/103462

1 comment:

  1. How to convert this to vfp, using gdiplusx

    VOID Example_LevelsSetParameters(HDC hdc)
    {
    Graphics graphics(hdc);
    Image myImage(L"Photograph.jpg");

    REAL srcWidth = (REAL)myImage.GetWidth();
    REAL srcHeight = (REAL)myImage.GetHeight();
    RectF srcRect(0.0f, 0.0f, srcWidth, srcHeight);
    Matrix myMatrix(1.0f, 0.0f, 0.0f, 1.0f, 450.0f, 20.0f);

    LevelsParams myLevelsParams;

    myLevelsParams.highlight = 100; // no change
    myLevelsParams.midtone = 0; // no change
    myLevelsParams.shadow = 20; // Darken the dark areas.

    Levels myLevels;
    myLevels.SetParameters(&myLevelsParams);

    // Draw the image with no change.
    graphics.DrawImage(&myImage, 20.0, 20.0, srcWidth, srcHeight);

    // Draw the adjusted image.
    graphics.DrawImage(&myImage, &srcRect, &myMatrix, &myLevels, NULL, UnitPixel);

    ReplyDelete