KiXforms Forum Index KiXforms
The Forum for the KiXforms Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Quick Links 
Site News
Downloads
Documentation
Donations
Script Archive
Tracking Systems

Image on a button - how?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    KiXforms Forum Index -> KiXforms.NET Discussion
View previous topic :: View next topic  
Author Message
masken
KiXforms Enthusiast
KiXforms Enthusiast


Joined: 14 Mar 2003
Posts: 202
Location: Gothenburg, Sweden

PostPosted: Wed Feb 14, 2007 8:06 pm    Post subject: Image on a button - how? Reply with quote

So I'm trying to create a button with an image on it. The image is a GIF (file) with transparency. Will this work, if so, how? Nothing in the help file Sad

Code:

$BtnDoXML = $System.Button()
     $BtnDoXMLImage = $System.Image.FromFile("@SCRIPTDIR\Images\btn_parse_wii_xml.gif")
     $BtnDoXML.Image = $BtnDoXMLImage
     $BtnDoXML.Height = 50
     $BtnDoXML.Left = $LVTitles.Left + 5
     ;$BtnDoXML.Text = "XML"
     $BtnDoXML.Top = $BtnLVTitlesSelectAll.Bottom + 10
     $BtnDoXML.Width = $BtnDoXML.Height
     $BtnDoXML.FlatStyle = 3
     $BtnDoXML.Enabled = 0
     $BtnDoXML.Click = "PopulateLVTitles()"
     $nul = $FrmMMM.Controls.Add($BtnDoXML)
Back to top
View user's profile Send private message MSN Messenger
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Wed Feb 14, 2007 8:58 pm    Post subject: Reply with quote

Is your code not working ? Is the transparency not working ?
Back to top
View user's profile Send private message
masken
KiXforms Enthusiast
KiXforms Enthusiast


Joined: 14 Mar 2003
Posts: 202
Location: Gothenburg, Sweden

PostPosted: Wed Feb 14, 2007 9:12 pm    Post subject: Reply with quote

oh, sorry hehe.. there's no image at all, just a blank button...

The image I'm trying to put on the button is 32x32 pixels.
Back to top
View user's profile Send private message MSN Messenger
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Wed Feb 14, 2007 9:28 pm    Post subject: Reply with quote

Can you zippup the icon and post to this thread ?
Back to top
View user's profile Send private message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Wed Feb 14, 2007 11:45 pm    Post subject: Reply with quote

Here's a little script that show animated gifs ... it uses base64 embedded images to show that these can be included directly into scripts ...

The script is attached.



ani.kix
 Description:
Animated Gif Script

Download
 Filename:  ani.kix
 Filesize:  22.77 KB
 Downloaded:  1183 Time(s)

Back to top
View user's profile Send private message
masken
KiXforms Enthusiast
KiXforms Enthusiast


Joined: 14 Mar 2003
Posts: 202
Location: Gothenburg, Sweden

PostPosted: Thu Feb 15, 2007 8:07 am    Post subject: Reply with quote

Here's the GIF:

Back to top
View user's profile Send private message MSN Messenger
masken
KiXforms Enthusiast
KiXforms Enthusiast


Joined: 14 Mar 2003
Posts: 202
Location: Gothenburg, Sweden

PostPosted: Thu Feb 15, 2007 10:34 pm    Post subject: Reply with quote

I'm going crazy here.. this is the code and I've even converted it to Bas64, all I'm getting is a blank button (using the latest KiXforms v.3.x):

Code:

$ImgBtnParseWIIXML = "
R0lGODlhIAAgAPcAAPjr8X58fvz7/IqJiujh69rW4tfT49jX3hgQVqei0m9qnczK4a+s96Si
4aSi0cvK6bm40WZk/n58/I6M8ZeV/qGf7aOi5J6dy5STvLa13wAA+gAA5Rsb9hkZ4R8f8DAw
+1pZ+l5e915d5GZm9UlJsG5u9HBw71pauWhp1Gxs2Xh443l544iI9YCA2oWF1Z2d7oSEwra2
49/f5qCgpNvb3p+foUxMTd/f4by8vbm5uqOjpKCgoV9mwE5YwLGzx1Bdwq+4+k1gyFZlwV9t
xmFwx5uk3Z+jvXF6qlpvyAAnq6i468TO7hVa/3yg95aftba7xlJhfRRKl9jm+tHe8qjK97Cx
sgqH7jZ3r8nS2QWb5ymp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AkjDGvszXLJJgAQAkggwFDCiQ321KNf
flb1J42EY7A2CCidJIDFH3XQgQcQMUCgyQDvMOcMOPKYcyKKY6QhkBnHODAEFWHIQYYVUTjx
gw+CxJOfM/LcY+U6woyh5RjVyHNMIUUgwUcTYGShxRV3/CJFEEbE0hw498gzTpXrcNmcl7Us
IcQUZ8ThxRZz9BGAEkQ8QYtVwlQ5Dj7YxLlfl8fUsIoBPcDhxxdMJFHGETzwUko7ElYDpzzY
VCnPG/t5yV4mBRBwCBQIKM4QzAIHoALNMFZpWaWVp6J65zHsWSJsKJHAMoknlbDCDDRiaIke
j0jhtx+Px+zySQYMVNBABLK4YMELmCQTjRj+SeiLc+j+Wq0nD3CAwQQbwKABCiNIokw07JTr
y7m3jUjtMTqsUowHElBwAgkdpFACJMtAk++J+47Y7wxeCtSNACJcAMIKLJigQgsfhEBKNPD4
KEzEDtb2r0DfGEPDK6K0coopqahygwzKPHMOOOaA48uIViFV8UDlpKPOOegkjc45TCu9zkDm
CI2UOQcFBAA7"

$BtnDoXML = $System.Button()
     $ImgBtnParseWIIXML = $System.Bitmap.FromBase64String($ImgBtnParseWIIXML)
     $BtnDoXML.Height = 50
     $BtnDoXML.Width = $BtnDoXML.Height
     $BtnDoXML.Left = $LVTitles.Left + 5
     $BtnDoXML.Top = $BtnLVTitlesSelectAll.Bottom + 10
     $BtnDoXML.FlatStyle = 3
     $BtnDoXML.Enabled = 0
     $BtnDoXML.Image = $ImgBtnParseWIIXML
     $BtnDoXML.Click = "PopulateLVTitles()"
     $nul = $FrmMMM.Controls.Add($BtnDoXML)
Back to top
View user's profile Send private message MSN Messenger
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Fri Feb 16, 2007 12:47 am    Post subject: Reply with quote

What if you take the FlatStyle off (or set it to 1) ?

[edit]
Heres something from a dotnet knowledge base:

Quote:
Unfortunately, setting the FlatStyle property of a Button control to FlatStyle.System makes it impossible to display an image on the face of the button. ...
Back to top
View user's profile Send private message
benny69
KiXforms Advocate
KiXforms Advocate


Joined: 30 Oct 2003
Posts: 567
Location: Lincoln, Ne

PostPosted: Fri Feb 16, 2007 12:58 am    Post subject: Reply with quote

The base64 string is good it works in this test form:
Code:

Break On
$System = CreateObject("Kixforms.System")
If Not $System
   $nul= MessageBox("KiXforms.Net Not Initiated. This Script Will Now Close.","Error",16)
   Quit()
EndIf

$Form = $System.Form()
$Form.StartPosition = $System.FormStartPosition_CenterScreen
$Form.Text = "Button Image"

$Button = $System.Button()
$Button.Height = 60
$nul = $Form.Controls.Add($Button)
$Button.Center

$Button.Image = ButtonImage()

$Form.Show

While $Form.Visible
   $Nul = Execute($Form.DoEvents())
Loop
Exit 0

Function ButtonImage()
$ButtonImage = "
R0lGODlhIAAgAPcAAPjr8X58fvz7/IqJiujh69rW4tfT49jX3hgQVqei0m9qnczK4a+s96Si
4aSi0cvK6bm40WZk/n58/I6M8ZeV/qGf7aOi5J6dy5STvLa13wAA+gAA5Rsb9hkZ4R8f8DAw
+1pZ+l5e915d5GZm9UlJsG5u9HBw71pauWhp1Gxs2Xh443l544iI9YCA2oWF1Z2d7oSEwra2
49/f5qCgpNvb3p+foUxMTd/f4by8vbm5uqOjpKCgoV9mwE5YwLGzx1Bdwq+4+k1gyFZlwV9t
xmFwx5uk3Z+jvXF6qlpvyAAnq6i468TO7hVa/3yg95aftba7xlJhfRRKl9jm+tHe8qjK97Cx
sgqH7jZ3r8nS2QWb5ymp7gCVxbi5ubW2tgiPeQBSQUzlvkKpiGx9d47/1C6UaitSQJSbl5yt
oiX/V2v/jwDcAAC5AACWAABzAI7/jsDcwMrXyk7QPUCdMC2SGCatAI/yc4//ay1fGFF7P0nc
ADGWACVzAPn/9iyBAD2IELfnnMTsquPz1K2wqpialt7wyqGmm0pzANLUyP7+ANzcALm5AJaW
AHNzAP//jv//sf//1P394v//6fn54///7oKCefb26P//8v//8/Hx5f//9LKyqv//9V9fW///
9v//9///+P//+f//++np5f///O7u69PT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QzAIHoALNMFZpWaWVp6J65zHsWSJsKJHAMoknlbDCDDRiaIke
j0jhtx+Px+zySQYMVNBABLK4YMELmCQTjRj+SeiLc+j+Wq0nD3CAwQQbwKABCiNIokw07JTr
y7m3jUjtMTqsUowHElBwAgkdpFACJMtAk++J+47Y7wxeCtSNACJcAMIKLJigQgsfhEBKNPD4
KEzEDtb2r0DfGEPDK6K0coopqahygwzKPHMOOOaA48uIViFV8UDlpKPOOegkjc45TCu9zkDm
CI2UOQcFBAA7"
$ButtonImage = $System.Bitmap.FromBase64String($ButtonImage)
EndFunction

_________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)
Back to top
View user's profile Send private message Send e-mail
benny69
KiXforms Advocate
KiXforms Advocate


Joined: 30 Oct 2003
Posts: 567
Location: Lincoln, Ne

PostPosted: Fri Feb 16, 2007 1:07 am    Post subject: Reply with quote

Here is your Button Image with a transparent background:
Code:

Break On
$System = CreateObject("Kixforms.System")
If Not $System
   $nul= MessageBox("KiXforms.Net Not Initiated. This Script Will Now Close.","Error",16)
   Quit()
EndIf

$Form = $System.Form()
$Form.StartPosition = $System.FormStartPosition_CenterScreen
$Form.Text = "Button Image"

$Button = $System.Button()
$Button.Height = 60
$nul = $Form.Controls.Add($Button)
$Button.Center

$Button.Image = ButtonImage()

$Form.Show

While $Form.Visible
   $Nul = Execute($Form.DoEvents())
Loop
Exit 0

Function ButtonImage()
$ButtonImage = "
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1B
AACxjwv8YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAA
AAlwSFlzAAAOwgAADsIBFShKgAAABZZJREFUWEfFl11Mk1cYx99dLFl25cWWYLzwyi3L5uK4
2J2Z4w6jZnDBNhZlkI1sCgrqQD7jBBkjpCQMcBkyWuhEuxnBhY5OXECdOlwIH2Ugwkt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GzOARvfa0gOzMbFxvG
EZt0B9Zrt5HyVbK2KUUpDPl5Zw8nKzs1Akhv7peByko6hl50dzpx4KMmtHS3YHf+FiiR7+PV
aJal13/Gm5F7kJxuQUx8EwYdKjo723Dy5Emtq2lDOQNkLoDo2tTne6zL0jKgzQF23nv/GcRD
xzg67HcRGZuFkC1ROHa4Ak61D3+3ONDTrcLlcqK9vR1ZqanahqK2+h7QzIMDmGaZEFpi96OY
nWKjFG4mD+bmHmJkZBhOpw8gIStV62px1MQJEN+gxLDSRy8+x5vQXG1kBvOw1g/gyi8emCof
sxPhQPxnXjwe68PZs12orhpiA8iNqSkXxsbG0NbWxgHkCSfOOZ1/MSHla6D0SwAe3GsZxbZt
cyj5rhGGwimG5mJj9wa7LuKLL+2Ij5/FwoKTZWGEA6SkpAQAYF+/JQAxmOQBJUfPAaqrzbwJ
H42PY/v2SdbtyzhX6kV0tA3h4bXYutXBzvx9Nnie4OnTQdYDLl4CGcAXvc98relI60ajWTv/
2iAymUxYXlrGoYND+LHiHqI/XkRamhP5+bNISprAqVNONtV6sWvXEg4d8sDtHucZSExM1E27
tQHkCbnqX7PS0lKo/f148EDF2KiK0VEXhoYo1S52P8LuB1njOTAwQBrmJejq6kJ2djY/ejRy
6aqPXtRcNKQ4dqsAcnJykJmZiYyMDL5pVlaWn2hNSP4dH7PSN0oCkc3EPa2v9x/zvz/KoXzR
JP+2AAAAAElFTkSuQmCC"
$ButtonImage = $System.Bitmap.FromBase64String($ButtonImage)
EndFunction

_________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)
Back to top
View user's profile Send private message Send e-mail
masken
KiXforms Enthusiast
KiXforms Enthusiast


Joined: 14 Mar 2003
Posts: 202
Location: Gothenburg, Sweden

PostPosted: Fri Feb 16, 2007 3:15 pm    Post subject: Reply with quote

Ah, thanks!

As shawn says, if I set the style of the button to anything else than 3, it works Smile (4 makes it a beveled button with the same style and it works).

Thanks shawn & benny Smile

Is there a way to define the transparency color of the image in it's original form (the transparency in the image got fudged so it's really not transparent)?

(btw, a good thing to have in the chm)
Back to top
View user's profile Send private message MSN Messenger
benny69
KiXforms Advocate
KiXforms Advocate


Joined: 30 Oct 2003
Posts: 567
Location: Lincoln, Ne

PostPosted: Fri Feb 16, 2007 3:31 pm    Post subject: Reply with quote

Sure, this is the important code:
Code:

$ButtonImage.MakeTransparent($System.Color.FromName("Transparent"))

here is an example:
Code:

Break On
$System = CreateObject("Kixforms.System")
If Not $System
   $nul= MessageBox("KiXforms.Net Not Initiated. This Script Will Now Close.","Error",16)
   Quit()
EndIf

$Form = $System.Form()
$Form.StartPosition = $System.FormStartPosition_CenterScreen
$Form.Text = "Button Image"

$Button = $System.Button()
$Button.Height = 60
$nul = $Form.Controls.Add($Button)
$Button.Center

$Button.Image = ButtonImage()

$Form.Show

While $Form.Visible
   $Nul = Execute($Form.DoEvents())
Loop
Exit 0

Function ButtonImage()
$ButtonImage = "
R0lGODlhIAAgAPcAAPjr8X58fvz7/IqJiujh69rW4tfT49jX3hgQVqei0m9qnczK4a+s96Si
4aSi0cvK6bm40WZk/n58/I6M8ZeV/qGf7aOi5J6dy5STvLa13wAA+gAA5Rsb9hkZ4R8f8DAw
+1pZ+l5e915d5GZm9UlJsG5u9HBw71pauWhp1Gxs2Xh443l544iI9YCA2oWF1Z2d7oSEwra2
49/f5qCgpNvb3p+foUxMTd/f4by8vbm5uqOjpKCgoV9mwE5YwLGzx1Bdwq+4+k1gyFZlwV9t
xmFwx5uk3Z+jvXF6qlpvyAAnq6i468TO7hVa/3yg95aftba7xlJhfRRKl9jm+tHe8qjK97Cx
sgqH7jZ3r8nS2QWb5ymp7gCVxbi5ubW2tgiPeQBSQUzlvkKpiGx9d47/1C6UaitSQJSbl5yt
oiX/V2v/jwDcAAC5AACWAABzAI7/jsDcwMrXyk7QPUCdMC2SGCatAI/yc4//ay1fGFF7P0nc
ADGWACVzAPn/9iyBAD2IELfnnMTsquPz1K2wqpialt7wyqGm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7Us
IcQUZ8ThxRZz9BGAEkQ8QYtVwlQ5Dj7YxLlfl8fUsIoBPcDhxxdMJFHGETzwUko7ElYDpzzY
VCnPG/t5yV4mBRBwCBQIKM4QzAIHoALNMFZpWaWVp6J65zHsWSJsKJHAMoknlbDCDDRiaIke
j0jhtx+Px+zySQYMVNBABLK4YMELmCQTjRj+SeiLc+j+Wq0nD3CAwQQbwKABCiNIokw07JTr
y7m3jUjtMTqsUowHElBwAgkdpFACJMtAk++J+47Y7wxeCtSNACJcAMIKLJigQgsfhEBKNPD4
KEzEDtb2r0DfGEPDK6K0coopqahygwzKPHMOOOaA48uIViFV8UDlpKPOOegkjc45TCu9zkDm
CI2UOQcFBAA7"
$ButtonImage = $System.Bitmap.FromBase64String($ButtonImage)
$ButtonImage.MakeTransparent($System.Color.FromName("Transparent"))
EndFunction

_________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)
Back to top
View user's profile Send private message Send e-mail
masken
KiXforms Enthusiast
KiXforms Enthusiast


Joined: 14 Mar 2003
Posts: 202
Location: Gothenburg, Sweden

PostPosted: Fri Feb 16, 2007 3:41 pm    Post subject: Reply with quote

Ah, wonderful! Smile
Back to top
View user's profile Send private message MSN Messenger
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Fri Feb 16, 2007 4:18 pm    Post subject: Reply with quote

Benny beat me to it - but since I did the script, will post it anyways:

Code:

Break On

$System = CreateObject("Kixforms.System")

$Form = $System.Form()

$Button1 = $Form.Controls.Add($System.Button())
$Button1.Image = BlueButtonImage()
$Button1.Width = $Button1.Image.Width + 20
$Button1.Height = $Button1.Image.Height + 20
$Button1.BackColor = $System.Color.PaleGreen
$Button1.Center

$Button2 = $Form.Controls.Add($System.Button())
$Button2.Text = "Make Transparent"
$Button2.Width = 120
$Button2.Center
$Button2.Top = $Button1.Bottom + 10
$Button2.Click = "Button2_Click()"

$Form.Center
$Form.Show
While $Form.Visible
 $= Execute($Form.DoEvents)
Loop

Exit 0

Function Button2_Click()
 $Button1.Image.MakeTransparent($System.Color.FromRgb(254,254,254))
 $Button1.Refresh
EndFunction

Function BlueButtonImage()
$BlueButtonImage = $System.Bitmap.FromBase64String("
R0lGODlhOwA8APZGACUzPYuVn09cZh0dpTQ0oG2Dk09PxcnK2xIS1DQ00zhGUJnL62p0fEFQ
Wq61um5utUREpVlqdSQk1Tk8eiQkokhI0ouyy4aGynyGjmJis1NTkzQ0ukNIeSQkujExhubp
6k9P4SUl9BIS8zQ08o2N2sDHyy07RWpq3sv+/j9KWWptmkZGvBQUv32ZrDw8pDxCfEZG75qq
snSKmtnc3khOel9ve52hpkhWYVZkcKqq7F5gj1dX3y0tozw88zlCZnl6t5O+27Dq/qKi4oar
xL+/5aff/v7+/pKSxr78/mFh23yIscbG/nh46ri9wXR5pmB8lJWhqYyisnZ+g9/g41hYvM/R
34SiuJ/R85SuwDJCS4ONk3aNppCQ+Gp6m6CgyBwc1Ds7zS0t1j09vCwsuS0t8Rwc9Bwcu7a2
9tDQ+mqJp1xcpG1tzXp6yIaGvpaanoaG9js7jFJSpEREjjI8WG1t8aSk+GJi7KSssGl8itbW
/lhujGNjxbX1/lJibmJ2g76+/iwAAAAAOwA8AAAH/4BGgoOEhYaHiImKi4yNjo+QkZKTlJWW
hlMOUAEyBXh4fnhSAQ5Tl5NVNi1WFq1DVlYtLZ14EX19WlWnjU2sV1dAQEOynZ4FxwV+fn03
fQ67iE1RC0FFQFZbfhE3Nw3c3TcCfRE1ehEC3k3Qgx9QV3xBQC1+As01eMd4T341tt/Ntxpk
YfABWgksfJAsaBGhQR88W5xE/OGEjRMnKnT0qcfNWziBCtRdunMFRZAhfhpESLNFCZskOyrA
AAOjAogdSfZk0EFDQYOfHbMACGApRhEURbYIEJBGyY8TIHqECRNCAhkyI0b0gHGTys4XWbJ4
FGhCCqUYfFBcKdBAT8sTFf8ShMF6NQSZEGGybu1KRY2GOWG9CQRgN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ONoPHetUI7yWhkgkiYv4gBuYABO15ogBrjhVVYOs5jH3IhAAAAh/h9P
cHRpbWl6ZWQgYnkgVWxlYWQgU21hcnRTYXZlciEAADs=
")
EndFunction
Back to top
View user's profile Send private message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Fri Feb 16, 2007 4:22 pm    Post subject: Reply with quote

Hey Benny, thats neat:

$ButtonImage.MakeTransparent($System.Color.FromName("Transparent"))

What did you tell the image to do ? Is your image a gif ? And did you tell it to "make the transparent color transparent" ?

-Shawn
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    KiXforms Forum Index -> KiXforms.NET Discussion All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group