Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GDI+ drawing help
Message
De
14/09/2009 01:54:32
 
 
À
14/09/2009 00:30:36
Information générale
Forum:
Visual FoxPro
Catégorie:
Photos et traitement d'images
Divers
Thread ID:
01423662
Message ID:
01424050
Vues:
55
Thanks, your comments were great. I had not understood at all that the brush being created was the same size as the rectangle. I had seem some of your blogs, but te\he URL to the list of contents is great,.

>>I was the kid who flunked art class in 3rd grade because he could not draw a straight line, and my graphics ability has not improved much.
>>
>>But now I want to use GDI+ drawing to put some nice slight gradients here and there. I stole from the gdi+ examples an imagecanvas and put it on my form. In the init I have:
>>
>>LOCAL loBrush AS xfcLinearGradientBrush
>* just a local declaration for getting intellisense 
>>WITH _Screen.System.Drawing
>    * running system.app adds a system.drawing object to _screen.
>>  loBrush = .Drawing2D.LinearGradientBrush.New(This.Rectangle,;
>>     .Color.FromRGB(233,233,233), ;
>>     .Color.FromRGB(249,249,249),;
>>     1)
>   * Get a LinearGradientBrush object from the System.Drawing.Drawing2D namespace - 
>   * brush size is same as tis.rectangle,
>   * a gradient brush needs 2 colours
>   * From left to right - other values are 0,1,2,3
>
>>  This.oGfx.FillRectangle(loBrush, This.Rectangle)
>   * fill the imagecanvas  with the brush
>>ENDWITH
>>
>>
>>and I have absolutely no idea what I did. Rather than spend a day inside the gdi classes, can somebody give me the basics:
>>
>>1. The documentation on MSDN for gdi+ in VFP is skimpy at best. Any better source ?
>>2. I got that the system.app is giving me the .drawing2d.lineargradientbrush, but what am I making a "new" of? the rectangle already exists on the form in the size I want, so it seems this method paints the image canvas using the 2 colors and the gradient type, but what is the rectangle object doing there?
>>3. How can I use that rectangle object to do things like give curvature to the corners?
>>4. What is rendermode property?
>>
>>I think if I can get an idea what this rectangle object is and where it comes from and what props and metthds I could get going.
>>
>>Thanks.
>
>move the above code into the imgCanvas.BeforeDraw method and you are good to go. (Remove it form init). Also make the colours more contrasting for better seeing the effect.
>
>
>loBrush = .Drawing2D.LinearGradientBrush.New(This.Rectangle,;
>     .Color.Red, ;
>     .Color.Blue,;
>     1)
>
>
>See above for an explanation of what you did :) as I have commented your code.
>
>If you want more visit http://weblogs.foxite.com/bernardbout/archive/category/1076.aspx
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform