Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GdiPlusX - Images Stretch,Clip,Isometric
Message
De
15/01/2008 03:56:57
 
 
À
14/01/2008 21:53:18
Information générale
Forum:
Visual FoxPro
Catégorie:
VFPX/Sedna
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01281317
Message ID:
01281853
Vues:
11
Hi Cesar,

I downloaded latest GdiPlusX version (Production release jan/08) and noticed that for some reason my form with ImageCanvas instantiates tiny bit slower then version that was using up to now. In my case that is just enough to produce unpleasent visual effect of ImageCanvas showing briefly with those two lines across [X] which you normally see only in design mode.
After reverting to version I was using before (aprox build 2881) - Form becomes 'snappy' again and you see entire ImageCanvas drawn right away.

Any ideas what happened here ?






>>Dear All,
>>
>>I want to render picture in given area (rectangle or region) of ImageCanvas in 3 ways, similar to what VFP image object does with property Stretch ;
>>
>>0 - Clip
>>1 - Stretch
>>2 - Isometric
>>
>>Any help (sample) is greatly appreciated.
>>
>>TIA
>>Sergio
>
>Sergio,
>
>Please study the code below, it will help you to obtain the needed dimensions.
>I've been using it to calculate the needed dimensions for each of the 3 types of Stretching modes:
>
>As you are already familiar with GdiPlusX and GDI+ objects, I'll skip the introductory codes this time.
>
>
>
DO CASE
>CASE This.Stretch = 0 && Clip
>	This.RenderWidth  = MAX(1,MIN(This.oBmp.Width, This.Width))
>	This.RenderHeight = MAX(1,MIN(This.oBmp.Height, This.Height))
>
>CASE This.Stretch = 1 && Isometric
>
>	* Isometric Adjustment
>	LOCAL lnHorFactor, lnVertFactor, lnResizeFactor
>	m.lnHorFactor = This.Width / This.oBmp.Width
>	m.lnVertFactor = This.Height / This.oBmp.Height
>	m.lnResizeFactor = MIN(m.lnHorFactor, m.lnVertFactor)
>	This.RenderWidth = This.oBmp.Width * m.lnResizeFactor
>	This.RenderHeight = This.oBmp.Height * m.lnResizeFactor
>
>
>CASE This.Stretch = 2 && Stretch
>	This.RenderWidth = This.Width
>	This.RenderHeight = This.Height
>		
>ENDCASE
>
>
>Some extra notes:
>1 - This code is intended to reside in a ImageCanvas object
>2 - "This.oBmp" is the image you want to draw.
>3 - "This.RenderWidth/RenderHeight" represent the size of the image needed according to the stretch mode.
>
>
>If you have difficulties on this, feel free to call me again.
>
>Hope this helps
>
>Cesar
*****************
Srdjan Djordjevic
Limassol, Cyprus

Free Reporting Framework for VFP9 ;
www.Report-Sculptor.Com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform