Important alert: (current site time 7/16/2013 4:01:39 AM EDT)
 

winzip icon

Image Shaped Form Example (New Improved Version)

Email
Submitted on: 9/23/1999
By: Pedro Lamas  
Level: Intermediate
User Rating: By 5 Users
Compatibility: VB 4.0 (32-bit), VB 5.0, VB 6.0
Views: 26960
author picture
(About the author)
 
     Ever wanted to create a form with a shape defined by a picture? If so, this is what you have been looking for! With this simple example, you will be able to use any standard image to define the shape of a form. Along with the example, there is an ReadMe HTML file that explains how to create your own Image Shaped Forms! This is a new, improved version of my previous upload, with come corrections for WinNT!
 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
  3. Scan the source code with Minnow's Project Scanner

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 9 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

9/24/1999 7:31:00 AMT-Soft

I try your project but when i'm loading it, i see no color in it (it's in white only). And it does not refresh correctly

Can you explain it
Thank ByE
(If this comment was disrespectful, please report it.)

 
9/24/1999 2:19:00 PMRuss

this is cooooool code-I like it!
(If this comment was disrespectful, please report it.)

 
9/25/1999 12:34:00 AMEwareZ

Works perfect, nice straight code.
very cool.
(If this comment was disrespectful, please report it.)

 
9/26/1999 1:39:00 PMSyntax

very GOOD code!!!!! well commented too!
good job!
(If this comment was disrespectful, please report it.)

 
10/5/1999 10:32:00 PMKayCee

Silly question from a newbie ...
When I try to open the project, I get a message that says "Retained" is not a valid key.
I think this has something to do with VB6, but I am only using VB5.
Can anyone help me.
Thx, Kevin
(If this comment was disrespectful, please report it.)

 
10/6/1999 2:47:00 AMplotoder

A single word for this great,cool,sexy code
AWESOME!!!!!!!!!!!!!!!!!!!!!!!!!!!!
(If this comment was disrespectful, please report it.)

 
10/8/1999 3:58:00 AMRob463

Very Impressive code. Just one thing, when you move the form, the outline of the form is always much larger than the actually original picture.
(If this comment was disrespectful, please report it.)

 
10/8/1999 5:10:00 PMJonathan Feucht

It works well, and I think this is really cool. Thankx
(If this comment was disrespectful, please report it.)

 
10/8/1999 7:09:00 PMvirgovin

to open a visual basic 6.0 project in vb5, you must open the project .vbp file in notepad, scroll to the bottom where it says retained and delete that line and that line only from the text. save it, and then open the project file in visaul basic 5.0
(If this comment was disrespectful, please report it.)

 
10/8/1999 11:14:00 PMJustin Moser

I have an 18k OCX on my website that does exactly this. You just drop it on your form, tell it the color you want to exclude and thats it. If anyone wants to download it please feel free to do so, its free! :)
Hope it is usefull.
http://mozzysoft.hypermart.net

(If this comment was disrespectful, please report it.)

 
10/11/1999 8:39:00 AMDarrell

Neither this code nor the mozzysoft ocx appear to work on Windows NT. Can anyone explain why?
(If this comment was disrespectful, please report it.)

 
10/11/1999 9:20:00 AMJustin Moser

Darrell,
I just checked my code, i thought it may have been a non-compatable declare but they check out fine. Does the OCX do anything, errors, weird efects, crash,ect, Could be something simple. I will look into it further.
(If this comment was disrespectful, please report it.)

 
10/13/1999 5:57:00 AMSimon

When I try to open the project in VB4 I get the error the file is corrupt. However, I get this with all forms and projects downloaded from Plantsource so far?
(If this comment was disrespectful, please report it.)

 
10/13/1999 7:01:00 PMJustin Moser

Simon: The most likely reason for that
is compatability between versions of
VB. Form Tracer for example was written
in VB5.

(If this comment was disrespectful, please report it.)

 
10/15/1999 5:16:00 AMalgo

Regarding the refresh problem in WinNT, believe the DeleteObject is somehow destroying the Picture object that VB uses to paint the form's Picture. I did the following:

- Add an Image control to ShapedForm, placing it at (0,0).
- Set the Picture properties of the contorl and ShapedForm, to the same image file.
- Copy ShapedForm's MouseMove handler to that of the Image control.
- In "mChangeBackgroundPicture_Click()", add the following line after "ShapedForm.Picture = LoadPicture(.FileName)":

ShapedForm.Image1.Picture = LoadPicture(.FileName)

...it's a bit of a hack, but it works (for me) with minimal effort.
(If this comment was disrespectful, please report it.)

 
10/16/1999 12:09:00 AMuXPDC

Very interesting code!!! This is code what i
want....
(If this comment was disrespectful, please report it.)

 
10/20/1999 3:28:00 AMJanak

Fantastic!!!
(If this comment was disrespectful, please report it.)

 
10/20/1999 9:20:00 AMNightshadow

To make it work on NT, change:
hDC = CreateCompatibleDC(0) to hDC = CreateCompatibleDC(frm.hDC) [where frm is the form name]


(If this comment was disrespectful, please report it.)

 
10/20/1999 9:25:00 AMNightshadow

[append to previous post] And set forms AutoRedraw property to True.
(If this comment was disrespectful, please report it.)

 
10/22/1999 4:31:00 AMTom

I've always wanted to know how to do that!
(If this comment was disrespectful, please report it.)

 
5/24/2001 11:19:50 AMPedro Lamas

Thank you al for your comments on this code.
I've prepared a new, improved and faster version of this code.
If you want to get it, just send me an E-mail asking for it and i'll send it to you!
(If this comment was disrespectful, please report it.)

 
7/29/2003 8:15:35 PM

It'd be cool, if you could make it so that it would generate code to make a form of that shape
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.