ScriptSpot

Forum topic · General Scripting

scale big picture on a label

By artrender.info · 2013-04-03

Description

How to scale a picture (001.jpg) which has its own dimensions to display on a label


dotNetControl dropbtn "System.Windows.Forms.Label" pos:[50,4] width:155 height:121 

This code:


dropbtn.image = (dotNetclass "System.Drawing.image").fromfile "d:\folder\001.jpg"

is displaying a portion of the image inside 155x121px

Comments (12)

artrender.info · 2013-04-18

""

artrender.info · 2013-04-16

""

thx

artrender.info · 2013-04-04

It seams .ImageAlign works only with dropbtn.image not with dropbtn.BackgroundImage
But .image does not have ImageLayout property

:(

OH YESSSS

artrender.info · 2013-04-03

This is a GREAT Tool to use! I was working just like a stupid without knowing this!

COOOOOOOOOOOOOOL

artrender.info · 2013-04-03

THX! Its new for me!
I see .ImageAlign
but how to use it?
and .Left

:)

barigazy · 2013-04-03

when you find props then you need to go again but with props


showproperties dropbtn.ImageAlign

end you will end up with this

dropbtn.ImageAlign = dropbtn.ImageAlign.Left

barigazy · 2013-04-03

try by yourself this in the listener


dropbtn = dotNetobject "Label"
showproperties dropbtn -- to show all properties
showmethods dropbtn -- to show all methods
showevents dropbtn -- to show all events

I can't remeber if there "align" properties for bgimage but for image is there for sure, you can try to find

position

artrender.info · 2013-04-03

is it possible to align it to the left?
If I use zoom then it positions it in the center!

Thx barigazy! SOLVED

artrender.info · 2013-04-03

the only thing is


dropbtn.BackgroundImage = (dotNetclass "System.Drawing.image").fromfile...

but your suggestion is WONDERFUL!

barigazy · 2013-04-03

BackgroundImageLayout properties : Stretch ; None ; Center ; Zoom ; Tile

dotNetControl dropbtn "System.Windows.Forms.Label" pos:[50,4] width:155 height:121
dropbtn.BackgroundImage = dropbtn.BackgroundImage.fromfile "d:\folder\001.jpg"
dropbtn.BackgroundImageLayout = dropbtn.BackgroundImageLayout.Stretch