Print Page | Close Window

can not use attribute Stretch in version 12.1.0

Printed From: Codejock Forums
Category: General
Forum Name: XAML Snippets
Forum Description: Post your XAML snippets here for everyone to enjoy :)
URL: http://forum.codejock.com/forum_posts.asp?TID=15870
Printed Date: 27 September 2024 at 9:51am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: can not use attribute Stretch in version 12.1.0
Posted By: rienzi
Subject: can not use attribute Stretch in version 12.1.0
Date Posted: 16 December 2009 at 5:05am
i can not use attribute Stretch in tag Image in XAML snippet in a CXTPButton object, the XAML snippet is:
 
<Image Source=' file://c:\\1.jpg Stretch= - file://c:\\1.jpg' Stretch= 'Fill' \>
 
 
the Xtreme lib version is 12.1.0
if I do not use Stretch attribute, the snippet works well
does this version support Stretch attribute in tag Image?
 
 
tell me please big master



Replies:
Posted By: Oleg
Date Posted: 16 December 2009 at 5:51am
Hi,
To Stretch it you need specify Width and Height of Image,
 
<Image Height='10' Width='20' Source=' file:///c://1.jpg%20Stretch= - file://c:\\1.jpg' Stretch= 'Fill' \>


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: rienzi
Date Posted: 16 December 2009 at 8:13pm

but the snippet still can not work well when the Height and Width attributes have been added, the XAML snippet is

<Image Height='10' Width='20' Source=' file:///c://1.jpg%20Stretch= - file://c:\\1.jpg' Stretch= 'Fill' />
 
if i delete the Stretch='Fill' part, the tag works well,
when that part is added, the entire XAML will be displayed as pure text on the CXTPButton,
 
in fact, i just wanna reduce the size of 1.jpg and display it on the CXTPButton control, smaller size without Stretch attribute can only show part of the jpg picture, i wanna show the whole jpg picture as a smaller size.
 
what can i do, tell me please big master


Posted By: Oleg
Date Posted: 17 December 2009 at 7:38am
Hi,
 
Just checked - Stretch was added in 12.1.1 release :-(


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: rienzi
Date Posted: 18 December 2009 at 12:31am
OK, I know now.
Thank you very much my big master


Posted By: Krog
Date Posted: 29 December 2009 at 10:19pm
I have a suggestion.

I have the need to have an attribute value for Stretch that works like this:

If the image size is smaller than or equal to the image element size, the image is NOT stretched.

If the image size is BIGGER than the image element, then it is stretched to be reduced.

Actually I am using code to implement it:

    If imImage.Height > (UserControl.Height \ 15 - 40) Then
      ImageCtl.Stretch = xtpMarkupStretchUniform
    Else
      ImageCtl.Stretch = xtpMarkupStretchNone
    End If

But sometimes we cannot do it, as when using markup.

And there are times where only the height or width of the element is fixed. In these cases the Stretch function may do the comparisons only for this fixed size.

Thanks in advance!

-------------
Product: Xtreme SuitePro (ActiveX) version 15.2.1
Platform: Windows XP SP2
Language: Visual Basic 6 SP6


Posted By: Oleg
Date Posted: 05 January 2010 at 8:27am
Hi,
 
Afraid I need some test project to see what you mean.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Krog
Date Posted: 05 January 2010 at 9:30am
Hi Oleg! Happy New Year!

Suppose that we have a markup label that has only an Image element on it, like this:

<Image Source='101' Stretch='Something'/>

And that the markup label has a size of 100x100 pixels (square).

I need to have the following behavior for Stretch:

If the image to be shown in the element has a small size (e.g. 50x80) then it does not need to be stretched.

But if the image is greater than the element size (e.g. 120x110) then the control would stretch the image so we can see all of it, redimensioned of course.

And if only one size of the image is greater (e.g. 120x80) then the image would be stretched also, but preserving its native aspect ratio.

I tried the 4 Stretch values (None, Fill, Uniform, UniformToFill) but no one does it.


Here is a sample:

uploads/20100105_092742_StretchTest.rar - 20100105_092742_StretchTest.rar

In the test project the only attribute value that does not stretch a small image is 'None'... And I need one that stretch only the big images, but not the small ones.


By the way, the installers are not creating the links for 2 files on the Documentation folder: "Symbol Reference" and "Markup Guide".

Regards!


-------------
Product: Xtreme SuitePro (ActiveX) version 15.2.1
Platform: Windows XP SP2
Language: Visual Basic 6 SP6


Posted By: jpbro
Date Posted: 05 January 2010 at 8:51pm
FWIW, I agree that this would be a nice feature - maybe Stretch='ShrinkUniform'? The image will only be shrunk (with aspect ratio preservation) if its width or height are greater than the containing element's width/height.


-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6



Posted By: Krog
Date Posted: 12 February 2010 at 1:57pm
Hi all!

Here is a new suggestion:

To use the Lanczos3 filter to do the stretch of images.

The reason is that the actual stretch is showing the images with a not so clear resolution.

I am showing images of products on the product base, photos of customers on the customers base, etc. and the photos and pictures when stretched are not so good, compared to the same image redimensioned on IrfanView using the Lanczos3 filter.

With Regards!

-------------
Product: Xtreme SuitePro (ActiveX) version 15.2.1
Platform: Windows XP SP2
Language: Visual Basic 6 SP6



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net