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

Using a .bmp as a form background

 
Post new topic   Reply to topic    KiXforms Forum Index -> Advanced Scripting
View previous topic :: View next topic  
Author Message
desverendi
KiXforms Novice
KiXforms Novice


Joined: 30 Mar 2006
Posts: 1

PostPosted: Thu Mar 30, 2006 8:45 pm    Post subject: Using a .bmp as a form background Reply with quote

Hi all, I'm wondering if it is currently possible to use a bitmap image file as a background for a form object? I've tried using Form.BackgroundImage but it doesn't seem to work or I'm using it wrong. Has anyone else tried this?

Thanks
Back to top
View user's profile Send private message
Gargoyle
KiXforms Aficionado
KiXforms Aficionado


Joined: 30 Dec 2003
Posts: 366
Location: Arizona

PostPosted: Thu Mar 30, 2006 11:02 pm    Post subject: Reply with quote

KF Classic 2.x or KF .Net

If .Net, then yes I know that it can be done.

KF Classic I do not recall and will bow to those here that do.

_________________
Parents were invented to make children happy by giving them something to ignore.
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 Mar 31, 2006 12:19 am    Post subject: Reply with quote

I am currently working on adding the BackgroundImage property to the Form object in kf classic. In the mean-time, you can use a PictureBox embedded inside a form, for the same effect. Then create your child controls as children of the PictureBox:

Code:

Break On

$System = CreateObject("Kixtart.System")

$Form = $System.Form()

$PictureBox = $Form.PictureBox()
$PictureBox.Dock = "Fill"
$PictureBox.Image = $System.Bitmap.FromBase64String(FormImageString())
$PictureBox.SizeMode = 1

$TextBox = $PictureBox.TextBox()
$TextBox.Left = 10
$TextBox.Top = 40
$TextBox.Text = "Testing..."

$Form.ClientWidth = $Picturebox.Image.Width
$Form.ClientHeight = $Picturebox.Image.Height

$Form.Center
$Form.Show

While $Form.Visible
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eWqlsnl4YQ5zilemJvKg+R7VPnRCd5VmvYD
5TW09NPdm/TTEF3QVr860nVu9OpNnJM/9zqwhX5zaTfc2D03+9e3mna11xzhH3d7yeFedm3n
HZJOt3sM8d52sq995Yr2uz8BP+i3d7Lqgzf83b22Nl7HPeeLd3yi0X5mynf97HW3fJPBnl3O
H1zxjfc8xBFfgkmOXex9Nzy8a3SyShde9LP3+AtTwPY1ubD2nc4lKP20eqaTPmaCsJQGqY5I
32ML5Hsf/nT13W8TsHnyfB598m+/JWT2GfnXjz4tudh6eCLY+8brfuUFr3voM7PKOGrxq2m/
fl323vo5pr/5j70h/oynH/3PN1ewj/wbncd6YWd73rdMzQdkredw+PcBGPRKwgd/DOhu63Jt
ubcyOPZ4CFh/1FeAG3eAc/d55/eBLoOB1Rd277d7HjiC/cdzLAgasgWDMcgd9TVNJwSB3fR6
ihVq3pQbFdhPOaiD1tY/4ud5QBiENdg/KChr/zJla5RuSnhIRqgZTah3eUeErpdSGaEsUGhH
UggJVFiFc8aFZZRPpLYvV+h26UNs6DCGuqaGZnhxjueFewWGYSgEQBdlZbaDPldwfjeH+lGH
dphvdveHgLiH01cpdrdkgWhuCXV1hYgF1nGIyDNvjyhlHYCJmaiJm8iJneiJnwiKGlAAADs="
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 Mar 31, 2006 2:15 am    Post subject: Reply with quote

There is a new dev build of Kixforms Classic. The version number is 2.46.39 ... The Form object now supports the BackgroundImage property ... here is a sample script:

Code:

Break On

$System = CreateObject("Kixtart.System")

$Bitmap = $System.Bitmap.FromBase64String(FormImageString())

$Form = $System.Form()

$Form.BackgroundImage = $Bitmap
$Form.ClientSize = $Form.BackgroundImage.Size

$Form.Center
$Form.Show

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

Exit 0

Function FormImageString()
$FormImageString ="
R0lGODlhPAFyAZEDACpJfQcvZxo9cwAAACH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D03+9e3mna11xzhH3d7yeFedm3n
HZJOt3sM8d52sq995Yr2uz8BP+i3d7Lqgzf83b22Nl7HPeeLd3yi0X5mynf97HW3fJPBnl3O
H1zxjfc8xBFfgkmOXex9Nzy8a3SyShde9LP3+AtTwPY1ubD2nc4lKP20eqaTPmaCsJQGqY5I
32ML5Hsf/nT13W8TsHnyfB598m+/JWT2GfnXjz4tudh6eCLY+8brfuUFr3voM7PKOGrxq2m/
fl323vo5pr/5j70h/oynH/3PN1ewj/wbncd6YWd73rdMzQdkredw+PcBGPRKwgd/DOhu63Jt
ubcyOPZ4CFh/1FeAG3eAc/d55/eBLoOB1Rd277d7HjiC/cdzLAgasgWDMcgd9TVNJwSB3fR6
ihVq3pQbFdhPOaiD1tY/4ud5QBiENdg/KChr/zJla5RuSnhIRqgZTah3eUeErpdSGaEsUGhH
UggJVFiFc8aFZZRPpLYvV+h26UNs6DCGuqaGZnhxjueFewWGYSgEQBdlZbaDPldwfjeH+lGH
dphvdveHgLiH01cpdrdkgWhuCXV1hYgF1nGIyDNvjyhlHYCJmaiJm8iJneiJnwiKGlAAADs=
"
EndFunction
Back to top
View user's profile Send private message
Jochen
KiXforms Devotee
KiXforms Devotee


Joined: 05 Mar 2003
Posts: 1204
Location: Stuttgart, Germany

PostPosted: Fri Mar 31, 2006 8:15 am    Post subject: Reply with quote

Hmmm ... isn't it better to embed a panel object as the backgroundimage holder ?

Well, I haven't tried it with Picturebox but had satisfying results (on the child controls) when adapting Kixtris' backgroundimage to be in the source (base64).

Does it matter? IIRC .Panel was better regarding child controls Confused

_________________
Jochen

Tell me, and I will forget.
Show me, and I may remember.
Involve me, and I will understand.
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 Mar 31, 2006 11:23 am    Post subject: Reply with quote

I made the Form support the BackgroundImage property only because .NET allows you to do that (kf.classic was always kinda based on .NET) but I agree with you. The PictureBox "can be" a better choice because one has more "control" over how the picture displayed (tiled versus stretchy for instance) - this is no different than how things work in .NET. The Form BackgroundImage can be a quicky to setup and use though.
Back to top
View user's profile Send private message
5861king
KiXforms Follower
KiXforms Follower


Joined: 23 Jan 2005
Posts: 15

PostPosted: Wed Oct 31, 2007 2:55 pm    Post subject: Reply with quote

is there away useing the PictueBox method. I have tried the following but no picture shows.

My Old Code that Works
Code:

$PictureBox1 = $Form.Controls.PictureBox()
$PictureBox1.BorderStyle = 1
$PictureBox1.Height = 131
$PictureBox1.Left = 30
$PictureBox1.Picture = "\\server\Sulogin$\ccforms\ccLogo.bmp"
$PictureBox1.Top = 30
$PictureBox1.Width = 233


New Code
Code:

$PictureBox1 = $Form.Controls.PictureBox()
$PictureBox1.BorderStyle = 1
$PictureBox1.Height = 131
$PictureBox1.Left = 30
$PictureBoxS1 = $System.Bitmap.FromBase64String(PictureBox1Image()) 
$PictureBox1.Picture = $PictureBoxS1 
$PictureBox1.Top = 30
$PictureBox1.Width = 233
$PictureBoxS1.Show


Also the Picture box is in a groupbox

Any ideas!!!!

TIA
5861king (Newbie) Smile
Back to top
View user's profile Send private message
5861king
KiXforms Follower
KiXforms Follower


Joined: 23 Jan 2005
Posts: 15

PostPosted: Wed Oct 31, 2007 10:47 pm    Post subject: Reply with quote

O.k, managed to resolve this one, its always the simple things i seem to miss out Razz
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    KiXforms Forum Index -> Advanced Scripting All times are GMT
Page 1 of 1

 
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