Library tutorials & articles

Skinning (BitBlt Introduction)

Introduction

Do you like the look of those fancy apps like Winamp or Media Player? The ones with stylish interfaces, lots of special effects and generally look downright cool? Is your new killer app dying for a makeover? If the answer is yes then you need to skin your app. Skinning your app can go from easy to dreadfully difficult depending on how far you want to distance your app from normal windows controls.

You might think as a VB developer, VB isn't powerfull enough to run an app and skin it at the same time, but with the help of the API it can. To begin with we're going to make a form that gets cover with a 'skin' onto which you could add buttons, while this isn't the perfect kinning method it's a start and a nice introduction to the GDI (Graphics Device Interface) API.

Comments

  1. 07 Feb 2007 at 04:37
    umm.... how do i fix the obstruction problem? help wanted fom any1
  2. 10 Feb 2006 at 09:56


     thanks for the great material you posted but unfortunatelly for me
     it all is in VB6. Can you show me a VB.NET example for this problem
     
    thanks

  3. 16 Nov 2005 at 21:38

    there's a sample code in vb.net on this website that changes text to html. maybe you can use it?

  4. 17 Jun 2005 at 12:15


    You can use a simple random XOR shift to do the 'encrypting'... as you probably know XOR of XOR gives original, so you can use the same for encoding/decoding provided the shift key is right. If you supply the file (binary) to this function, then it'll return encoded with the given key.
    If you pass the encoded file, it'll return the original file.


    [courier new]
    Public Function EncodeDecode(Data As String, Key As Long) As String
    On Error Resume Next


    Dim I As Long, X As Single
    Dim CharNum As Integer, RandInteger As Integer
    Dim SingleChar As String * 1
    Dim ReturnData As String


    X = Rnd(-Key)


    For I = 1 To Len(Data)
     CharNum = Asc(Mid$(Data, I, 1))
     RandInteger = Int(256 * Rnd)
     CharNum = CharNum Xor RandInteger
     
     SingleChar = Chr(CharNum)
     ReturnData = ReturnData & SingleChar
    Next I


    EncodeDecode = ReturnData
    End Function
    [/courier new]


    But how do you make a key out of password ? Convert it to a number that vastly varies according to the password...


    [courier new]
    Public Function ConvertPassKey(Key as String) As Long
    Dim I As Integer, Num As Long


    Key = LCase(Key)
    Num = 1
    For I = 1 To Len(Key)
    Num = Num + (I * Asc(Mid(Key, I, 1)))
    Next I


    ConvertPassKey = Num
    End Function
    [/courier new]


    Be VERY, VERY WARY  of the data you pass to the function. A slight shifting of even a single character will ruin the entire decoding process, and you'll get junk data!!!


    I suggest you do multiple "parity" checks before actually give it up for decoding....


    Also, encoding/decoding takes some time... that's why i prefer my tried and tested method "mangle da header!"
    Enjoy !

  5. 17 May 2005 at 04:39

    how to encrypt picture files using visual basic so that only certain people who know the password can see the picture

  6. 15 Oct 2004 at 16:10

    Be Happy....Baby

  7. 04 Apr 2004 at 07:20

    hello friends
    now i am in trouble.plz help me in convert the doc file into html format using vb
    programing code.
    plz help me i wait yours reply

  8. 01 Jan 1999 at 00:00

    This thread is for discussions of Skinning (BitBlt Introduction).

Leave a comment

Sign in or Join us (it's free).

Marc Pritchard Apart from my school work I put most of my effort into running my joke site, I'd like to think that it makes someone smile each day. For about 1/2 a year I've been programming more and more in serv...
AddThis

Related discussion

Related podcasts

  • Christian Beauclair

    14 mai 2008 (�mission #0074) ::.Christian Beauclair: Stratégies de migration VB6 vers .NET Nous discutons avec Christian Beauclair des stratégies de migration VB6 vers .NET. Entre autres, nous discutons comment utiliser le "VB 6 Code Advisor" et le "Interop Forms Toolkit" pour ajouter la puiss...

Want to stay in touch with what's going on? Follow us on twitter!