Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GdiPlusX - Images Stretch,Clip,Isometric
Message
From
15/01/2008 08:17:15
 
 
To
15/01/2008 03:56:57
General information
Forum:
Visual FoxPro
Category:
VFPX/Sedna
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01281317
Message ID:
01281872
Views:
13
Hi Sergio,

There were some modifications in the ImageCanvas initialization, in order to make it run faster, but it seems that for your case it did not happen.

I'll check this out tomorrow, and will let you know if some new modifications will be needed there.

Thanks

Cesar


>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform