Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 263
  • Last Modified:

Transparent Form + Transparent GIF = Splash Screen

Im Hoping Someone Can Shed A Little Or Preferably ALOT Of Light On My Problem. I Have A .gif With A Transparent Background Which I Place In An Image Control And When I Make The Form Transparent Everything Disappears.
 
The API Calls I'm Using To Make The Form Transparent Are:

Public Const GWL_EXSTYLE = (-20)
Public Const WS_EX_TRANSPARENT = &H20&
Public Const SWP_FRAMECHANGED = &H20
Public Const SWP_NOMOVE = &H2
Public Const SWP_NOSIZE = &H1
Public Const SWP_SHOWME = SWP_FRAMECHANGED Or SWP_NOMOVE Or SWP_NOSIZE
Public Const HWND_NOTOPMOST = -2

Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long


Public Sub MakeFormTransparent(FormObject As Form)
    SetWindowLong FormObject.hwnd, GWL_EXSTYLE, WS_EX_TRANSPARENT
    SetWindowPos FormObject.hwnd, HWND_NOTOPMOST, 0&, 0&, 0&, 0&, SWP_SHOWME
End Sub


Any Help Would Be Greatly Appreciated
0
mgronlund
Asked:
mgronlund
  • 5
  • 4
  • 2
  • +1
1 Solution
 
KDivadCommented:
I've always suspected that an image control doesn't really exist and the image is actually on the form itself (same with labels). If this is true, then your code will make it disappear along with the rest of the form.

Don't know of a way around it unless you use form-shaping APIs to crop the form to the same shape as the gif's image.
0
 
VincentLawlorCommented:
<Ping>
0
 
mgronlundAuthor Commented:
Thought About Doing That First But The Shape Is To Irratic
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
DennisBorgCommented:
:ping:
0
 
KDivadCommented:
You can try a web-search for VB Shaped Form Creator. Last time I checked, you could use it to create shapes from images. It wasn't very good, but may have improved since then...
0
 
mgronlundAuthor Commented:
Tried It, Doesnt Do A Terrible Job But It Doesnt Do The Inside Transparentancies (Like The Center Of Od or a)

FYI Its At http://members.fortunecity.com/alexv/index.html?VBSFC.html
0
 
mgronlundAuthor Commented:
AHHHHHH NEVERMIND I Found An Option That Did What I Need Thanks!
0
 
KDivadCommented:
Great! Glad you got your problem worked out.
0
 
mgronlundAuthor Commented:
Just In Case Anyone Tries To Do What I Did You Need To Set The Edge Tracer To Use Rectangle File.

The Only Problem Is That (For Example) My Image Made 800+ Calls To The API, That In Itself Made The Routine Too Large For VB To Handle. You'll Need To Do A Search And Replace For Screen.TwipsPerPixelX + OffsetX And Screen.TwipsPerPixelY + OffsetY And Assign Them A Variable, Also Might Need To Assign ScaleY * 15 and  ScaleX * 15 To A Variable. End Results Are The Same Just Results In Smaller Code And Faster Execution Since VB Won't Have To Do 800+ Calculations

0
 
DennisBorgCommented:
mgronlund: Thank you for this latest comment. It certainly adds value to the PAQ.
0
 
KDivadCommented:
I agree. It's great when the asker posts their results back like this.
0
 
mgronlundAuthor Commented:
Try To Help Those That Help Me,... Have One Wuestion What Is The PING Messages?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 5
  • 4
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now