Codejock Forums Homepage
Forum Home Forum Home > General > XAML Snippets
  New Posts New Posts RSS Feed - can not use attribute Stretch in version 12.1.0
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

can not use attribute Stretch in version 12.1.0

 Post Reply Post Reply
Author
Message
rienzi View Drop Down
Groupie
Groupie


Joined: 20 August 2009
Status: Offline
Points: 38
Post Options Post Options   Thanks (0) Thanks(0)   Quote rienzi Quote  Post ReplyReply Direct Link To This Post Topic: can not use attribute Stretch in version 12.1.0
    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='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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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' Stretch='Fill' \>
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
rienzi View Drop Down
Groupie
Groupie


Joined: 20 August 2009
Status: Offline
Points: 38
Post Options Post Options   Thanks (0) Thanks(0)   Quote rienzi Quote  Post ReplyReply Direct Link To This Post 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' 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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 17 December 2009 at 7:38am
Hi,
 
Just checked - Stretch was added in 12.1.1 release :-(
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
rienzi View Drop Down
Groupie
Groupie


Joined: 20 August 2009
Status: Offline
Points: 38
Post Options Post Options   Thanks (0) Thanks(0)   Quote rienzi Quote  Post ReplyReply Direct Link To This Post Posted: 18 December 2009 at 12:31am
OK, I know now.
Thank you very much my big master
Back to Top
Krog View Drop Down
Groupie
Groupie


Joined: 06 February 2008
Status: Offline
Points: 100
Post Options Post Options   Thanks (0) Thanks(0)   Quote Krog Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Krog View Drop Down
Groupie
Groupie


Joined: 06 February 2008
Status: Offline
Points: 100
Post Options Post Options   Thanks (0) Thanks(0)   Quote Krog Quote  Post ReplyReply Direct Link To This Post 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:

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
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
Krog View Drop Down
Groupie
Groupie


Joined: 06 February 2008
Status: Offline
Points: 100
Post Options Post Options   Thanks (0) Thanks(0)   Quote Krog Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.188 seconds.