Results 1 to 3 of 3

Thread: PictureBox,remove background.

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2000
    Posts
    45
    Hi,
    I am using the PictureBox to move sum picture from one place
    to anther (The image control makes the picture blink while moving it).
    Is there anyway to remove the background from the PictureBox that it will be clear,
    Or anther way to used the Image control?

    Thanks

    [email protected]
    Or
    [email protected]

    Shaykan Nahum

  2. #2
    Junior Member
    Join Date
    Apr 2000
    Posts
    24

    Hmm...

    What kind of background is it? Is it the background set in properties or a background that is part of the bitmap/jpeg whatever picture file you have?

  3. #3
    Addicted Member Cbomb's Avatar
    Join Date
    Jul 1999
    Posts
    153

    Regions

    You can change the region of your picture box to the exact out line of the picture it contains. Read this -> http://www.vb-world.net/articles/shapedforms/ tips article, its a bout changing the shapes of forms with regions. Changing the shape of picture boxs is done exactly the same way. As you will see in the article there is a part on Initialising the Window, this is the code you should use:
    Code:
    'Declare the API
    Public Declare Function SetWindowRgn Lib "user32" _
    (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
    
    'Set up the region (Assuming the picture box is Picture1)
    Private Sub Form_Load()
         SetwWindowRgn Picture1.hwnd, MyRgn, True
    End Sub
    I reccomend that you also heck out the Visual Basic Shaped Form Creator, it helps to create regions way easy (there is a link in the article).

    Well I hope this helps you out!
    Cbomb
    Techie

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width