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

Base64 Bitmap Strip Viewer

 
Post new topic   Reply to topic    KiXforms Forum Index -> Script Archive
View previous topic :: View next topic  
Author Message
Chris S.
KiXforms Enthusiast
KiXforms Enthusiast


Joined: 05 Mar 2003
Posts: 241

PostPosted: Fri Aug 12, 2005 8:57 pm    Post subject: Base64 Bitmap Strip Viewer Reply with quote

Here is a little script to display your base64 bitmap strips. Enjoy!

Code:

Break On
 
$System = CreateObject("Kixtart.System")
 
$bitmap = fnBitmapStrip() ;Change this function for your base64 string
 
$ImageList1 = $System.ImageList
$ImageList1.ImageSize = 16,16
$ImageList1.TransparentColor = "Fuchsia" ;Change this property for your transparent color.
$ImageList1.AddStrip($System.Bitmap.FromBase64String($bitmap))
 
$LargeImageList1 = $System.ImageList
$LargeImageList1.ImageSize = 32,32
For $i = 0 to $ImageList1.Images.Count - 1
   $=$LargeImageList1.Images.Add($ImageList1.Images($i))
Next
 
$Form = $System.Form
$Form.Text = "IconViewer"
 
$Form.GroupBox1 = $Form.Controls.GroupBox()
$Form.GroupBox1.Height = 30
$Form.GroupBox1.Dock = 1
 
$Form.LargeIcon = $Form.GroupBox1.ToolButton
$Form.LargeIcon.Location = 5,2
$Form.LargeIcon.Width = 23
$Form.LargeIcon.Icon = 38
$Form.LargeIcon.OnClick = "fnChangeView('LargeIcon',0)"
$Form.LargeIcon.FlatStyle = 1
$Form.LargeIcon.Style = 1
 
$Form.DetailsIcon = $Form.GroupBox1.ToolButton
$Form.DetailsIcon.Location = $Form.LargeIcon.Right + 5,2
$Form.DetailsIcon.Width = 23
$Form.DetailsIcon.Icon = 41
$Form.DetailsIcon.OnClick = 'fnChangeView("DetailsIcon",1)'
$Form.DetailsIcon.FlatStyle = 1
$Form.DetailsIcon.Style = 1
 
$Form.SmallIcon = $Form.GroupBox1.ToolButton
$Form.SmallIcon.Location = $Form.DetailsIcon.Right + 5,2
$Form.SmallIcon.Width = 23
$Form.SmallIcon.Icon = 40
$Form.SmallIcon.OnClick = "fnChangeView('SmallIcon',2)"
$Form.SmallIcon.FlatStyle = 1
$Form.SmallIcon.Style = 1
$Form.SmallIcon.Pushed = 1
 
$Form.ListIcon = $Form.GroupBox1.ToolButton
$Form.ListIcon.Location = $Form.SmallIcon.Right + 5,2
$Form.ListIcon.Width = 23
$Form.ListIcon.Icon = 39
$Form.ListIcon.OnClick = "fnChangeView('ListIcon',3)"
$Form.ListIcon.FlatStyle = 1
$Form.ListIcon.Style = 1
 
$Form.ListView1 = $Form.Controls.ListView()
$Form.ListView1.Dock = "Fill"
$Form.ListView1.Columns.Count = 1
$Form.ListView1.LargeImageList = $LargeImageList1
$Form.ListView1.SmallImageList = $ImageList1
$Form.ListView1.OnClick = "fnListViewClick()"
$Form.ListView1.View = 2
 
For $i = 0 to $Form.ListView1.SmallImageList.Images.Count - 1
   $Item = $Form.ListView1.Items.Add($i,$i)
Next
 
$Form.Show
 
While $Form.Visible
   $=Execute($Form.DoEvents)
Loop
 
Exit 1
 
Function fnChangeView($Button,$View)
   
   $Form.LargeIcon.Pushed = 0
   $Form.DetailsIcon.Pushed = 0
   $Form.SmallIcon.Pushed = 0
   $Form.ListIcon.Pushed = 0
   
   $=Execute("$"+"Form."+$Button+".Pushed=1")
   $Form.ListView1.View = $View
   
EndFunction
 
Function fnListViewClick()
   
   $IconIndex = Val($Form.ListView1.FocusedItem.Text)
   $Form.Icon = $Form.ListView1.SmallImageList.Images($IconIndex)
   
EndFunction
 
Function fnBitmapStrip()
   ; To display your bitmap strip place your base64 "string" in between the
   ; quotes below.
   $fnBitmapStrip = "
      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"
EndFunction


Last edited by Chris S. on Mon Aug 22, 2005 5:19 pm; edited 1 time in total
Back to top
View user's profile Send private message MSN Messenger
It Took My Prozac
KiXforms Supporter
KiXforms Supporter


Joined: 15 Feb 2005
Posts: 65

PostPosted: Mon Aug 22, 2005 6:51 am    Post subject: Reply with quote

Hi Chris and Shawn,

When I run this script (without modification) using either version 2.3.0 or the latest development build, it instantly dies without giving an error message at the line

Code:
$ImageList1.AddStrip($System.Bitmap.FromBase64String($bitmap))


I have unregistered and re-registered the dll to make sure that registration isn't a problem. Any ideas? Confused Chris, are you running the latest development build or a slightly older one?
Back to top
View user's profile Send private message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Mon Aug 22, 2005 12:21 pm    Post subject: Reply with quote

The Base64 function is not very resilient to malformed strings - its tends to crap-out until one gets it "just right", suspect is something to do with the way your downloading it, or maybe even something with your editor.

Looking into it further.

-Shawn
Back to top
View user's profile Send private message
Chris S.
KiXforms Enthusiast
KiXforms Enthusiast


Joined: 05 Mar 2003
Posts: 241

PostPosted: Mon Aug 22, 2005 5:20 pm    Post subject: Reply with quote

I had an issue with the end quote on this script once. I edited the original post. Try again please.
Back to top
View user's profile Send private message MSN Messenger
It Took My Prozac
KiXforms Supporter
KiXforms Supporter


Joined: 15 Feb 2005
Posts: 65

PostPosted: Mon Aug 22, 2005 11:36 pm    Post subject: Reply with quote

Yep, that fixed it!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    KiXforms Forum Index -> Script Archive 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