Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Improved Image Control
Message
De
04/12/2007 10:58:21
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Titre:
Improved Image Control
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01273066
Message ID:
01273066
Vues:
110
I've been working on the improvement of the image control, basically in order to fix the PictureVal bugs, and to add some cool and new functions.

At the link below you can download one of the first versions of a prototype
It's very primitive yet, but it can show you what I want to achieve.

http://weblogs.foxite.com/files/cesarchalom/imagex/ImageX.zip


Below is the todo list, showing what has been done till now.

List of the improvements or fixes added:

- Rotate and Flip
- AngleRotation
- Make BackGround Transparent
- Select the color to become transparent - Default is the color from pixel (0,0)
- Reliable PICTUREVAL
- Allow aplying GDI+ directly, using some techniques from the ImageCanvas, like "oGfx" and "oBmp"
- Resize (Partial, see the Zoom property)
- Mouse Events
- Zoom

- SaveAs
&& This.oBmp.Save("c:Image.PNG", .Imaging.ImageFormat.Png)
- Print
&& This.oBmp.ToPrinter()


To do List:

- Effects (Negative, GreyScale, Brightness, etc)
- Smoothing Mode
- Interpolation Mode
- Enable the "BeforeDraw" method
- Change Color Depth
- Region select
- Copy/Paste (selection) into another Image control
- Copy (selection) to clipboard for use in other applications
- Compatibility with VFP Report Engine
- Alternative text for the case the image could not be loaded, or empty()
- Add reliable OBJTOCLIENT() function to allow objects to be inside PageFrames.
- Control the Visible event (now it is always visible)


I'm based in Craig Boyd's article published in FoxTalk some years ago.
It contains a VCX that is only a place holder, and contains the methods and properties that i need.
In the SCX, you'll find all the codes responsible for the image rendering.

Please run the file TESTIMAGEX2.scx, to understand what I made so far.

There are really few people that have tried this before, and I trust very much in your opinions regarding this.

The main issue problem is the flickering when the form is resized.

For this class, I didn't use the API BeginPaint. All I did was to call "Thisform.Draw" to make VFP redraw its controls.

During resize, to avoid the flickering, I thought of UNBINDING the WM_PAINT Windows event, and then call BeginPaint and then Thisform.Draw(), and after this is finished, Bind the WM_PAINT event again...

But in my first insight this did not work.

Do you have any suggestions regarding this ?

This version uses a VFP Container as placeHolder.
For the future, I want to use the original Image Object. If the Picture property is not empty, then it will behave as it should by default.
Then, BINDEVENT the PictureVal property, and for the case it receives a value, then my control would manage the images.


Thanks in advance for any suggestions or feedback !
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform