|
-
Apr 7th, 2010, 01:27 AM
#1
Thread Starter
Addicted Member
-
Apr 7th, 2010, 02:26 AM
#2
Thread Starter
Addicted Member
Re: Dynamic Shape Form
Updated. The zip in the first post contains the updates.
-
Apr 7th, 2010, 03:20 AM
#3
Re: Dynamic Shape Form
If you are interested can visit this link, use a class to use PNG images, unfortunately could not explain how it works because it complicates my language, but if you want you can put these images in PNG format with transparency and I can make an example.
-
Apr 7th, 2010, 03:51 AM
#4
New Member
Re: Dynamic Shape Form
Open frmShapedRgns, select the picture box, go to properties, load your picture into it (picture property). Run the program. Hit the button. Later stop program, go to frmtest, and position some controls to see where they fall, and experiment, I guess it's masking that domiannt bg color in your pic, so try high contrast images, and just see what falls out. you could sample the colors as they seem to work, and go to photoshop or something, and play around with shapes, based on that color palette, contrast.

then, as a quick cheat to run frmtest as your main form, you vanish frmShapeRgn at load, before clicking your shaped form, frmtest, into view
in frmShapeRgn load event>>>
Private Sub Form_Load()
cboRotation.ListIndex = 0 '<<< if you comment out these these you'll also have the mask visible
Command2.Enabled = False '<<< if you comment out these you'll also have the mask visible, and in two pieces, even the command button if you stretch it over masked and visible, will be cut in half, and both pieces will be movable, making 1 form into 2, and a bissected control, thats weird
chkAntiRgn = 0 '<<< if you comment out these you'll also have the mask visible
Me.Visible = False '<<<added
Command1_Click '<<<<added
End Sub
in half:

Both halves of command1 button can be clicked.
A sample high contrat pic:
Last edited by 10west; Apr 7th, 2010 at 04:24 AM.
-
Apr 7th, 2010, 05:55 AM
#5
Thread Starter
Addicted Member
Re: Dynamic Shape Form
Thank you for reply...but you don't understand me....i'm sorry maybe i'm not so clear...
I want to creat Dynamic shape combine "Icon" and "Panel" on runtime from code according my need...My shape form must be different and they will be not be "static picture" but shape create from code, combine base shape (Panel and Icon)
I figure out how work LaVolpe module and i use from my code but i don't need "static picture"
Last edited by cliv; Apr 7th, 2010 at 06:04 AM.
-
Apr 7th, 2010, 06:34 AM
#6
Thread Starter
Addicted Member
Re: Dynamic Shape Form
 Originally Posted by LeandroA
If you are interested can visit this link, use a class to use PNG images, unfortunately could not explain how it works because it complicates my language, but if you want you can put these images in PNG format with transparency and I can make an example.
Thank you. Very interesting .....
-
Apr 7th, 2010, 07:24 AM
#7
Re: Dynamic Shape Form
If I understand correctly, you are going to have to use
Paintpicture or Bitblt to draw the icon pics onto the panel pics
and use the resulting picture as your form shape. For example,
I used Paint to paint Icon1 onto Panel1 & it worked fine,
although the icon pics need to be about half their size
to fit in the upper left corner.
-
Apr 7th, 2010, 07:55 AM
#8
Thread Starter
Addicted Member
Re: Dynamic Shape Form
 Originally Posted by VBClassicRocks
If I understand correctly, you are going to have to use
Paintpicture or Bitblt to draw the icon pics onto the panel pics
and use the resulting picture as your form shape. For example,
I used Paint to paint Icon1 onto Panel1 & it worked fine,
although the icon pics need to be about half their size
to fit in the upper left corner.
Can be Paint with transparency...? Can you post sourcecode..?
-
Apr 7th, 2010, 08:02 AM
#9
Re: Dynamic Shape Form
 Originally Posted by cliv
Can be Paint with transparency...? Can you post sourcecode..?
Shaped forms that contain controls are problematic.
1. Using a form shaping routine like the one you referenced requires one color to be transparent throughout the entire image. The downside with using regions is that your shape has jaggies around corners and diagonal lines.
2. Using SetLayeredWindowAttributes and UpateLayeredWindow APIs allows you to create a shape based off a nice alphablended PNG and supports alphablended edges. However, controls on the form become invisible and non-reactive to GUI changes (focus, pressed, hot, etc, etc). You may want to search the forum for those key API names and find some examples and read about additional issues encountered.
-
Apr 7th, 2010, 01:31 PM
#10
Thread Starter
Addicted Member
Re: Dynamic Shape Form
 Originally Posted by LaVolpe
Shaped forms that contain controls are problematic.
1. Using a form shaping routine like the one you referenced requires one color to be transparent throughout the entire image. The downside with using regions is that your shape has jaggies around corners and diagonal lines.
2. Using SetLayeredWindowAttributes and UpateLayeredWindow APIs allows you to create a shape based off a nice alphablended PNG and supports alphablended edges. However, controls on the form become invisible and non-reactive to GUI changes (focus, pressed, hot, etc, etc). You may want to search the forum for those key API names and find some examples and read about additional issues encountered.
Thank you LaVolpe...your advice are always welcome...Thank you
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|