 |
|
 |
How to change the transparency dynamically?
|
|
|
|
 |
|
 |
Hiyas, love this in general, but I've got a problem with my form. When I drag it around the background where my controls are shows through. It sorts itself out when the drag stops, but during the drag it's as if the controls on top of the form are lagging behind the form's movement, hence bits of the underneath show through until they `catch up'.
Here's what I'm doing:
(1) Each control (buttons) has a rectangle in the skin that's transparent.
(2) I place a marker into each rectangle where a control is to appear (border = 0)
(3) I place the control over the transparent box such that it fits perfectly.
As I say, when dragging the edges around the controls show through to the desktop.
Any hints?
|
|
|
|
 |
|
 |
I means program like editor audio or video with beautiful slider, pot etc.
|
|
|
|
 |
|
 |
I have seen the article for [An Alpha Channel Composited Windows Form with Designer Support] for c sharp. How do i do that in vb 2010
I would like to smooth out the edges of a circular form in VB. Any method that works is welcome
|
|
|
|
 |
|
 |
it is Difficult 2 use, so anybody tell me how can we use it simply
|
|
|
|
 |
|
 |
Hello!
I wanted to thank you for your project, it been a hell of a good helper for me
During the use I noticed 2 things that bugs me a lot...
First is the CanDrag option... No matter what I will set in the properties window or even in code, the form is still drag-able
Second is pretty unussual, and I dont sure that is fixable. The problem is that my form suppossed to be a child of the desktop. I achieve it by this code:
IntPtr hDesk = FindWindow("Progman", "Program Manager");
if (hDesk != IntPtr.Zero)
{
hDesk = FindWindowEx(hDesk, IntPtr.Zero, "SHELLDLL_DefView", "");
if (hDesk != IntPtr.Zero)
{
hDesk = FindWindowEx(hDesk, IntPtr.Zero, "SysListView32", "FolderView");
if (hDesk != IntPtr.Zero)
{
SetParent(this.Handle, hDesk);
}
}
}
And it works fine for a regular form. But when I did this to a form that had alphaFormTransformer, it had a wierd effect.
The region of the form, was the child of the desktop... But the PNG that is the background for alphaFormTransformer, acted like a ussual window(could get on top of other windows).
Can you help me to get rid of this annoying effect? Thanks!
|
|
|
|
 |
|
 |
We're developing a small app using alphaform to make a nice user interface. (thanks a lot for alphaform!, is a lifesaver!)
In some of our test machines, we are getting this exception:
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at AlphaForm.AlphaFormTransformer.UpdateRectListFromAlpha(ArrayList rectList, Rectangle& bounds, Point seedPt, Byte[,] alphaArr, Int32 width, Int32 height, Int32 border)
at AlphaForm.AlphaFormTransformer.UpdateSkin(Bitmap frameBmap, Bitmap backBmap, Byte opacity)
at AlphaForm.AlphaFormTransformer.TransformForm(Byte opacity)
We don't know why it happens, the skin is always the same, and we don't understand why in most cases it's working normally, and in some other is not.
|
|
|
|
 |
|
 |
Spot the bug in the following excerpt of code from v1.1.3:
public void UpdateSkin(Bitmap frameBmap, Bitmap backBmap, byte opacity)
{
// From an internal perspective, frameBmap is the layered window contents
// and backBmap becomes (potentially after scaling) the transformer control
// BackgroundImage.
if (frameBmap == null && backBmap == null)
throw new ApplicationException("Must specify at least one bitmap to UpdateSkin()");
if (!Bitmap.IsCanonicalPixelFormat(frameBmap.PixelFormat) || !Bitmap.IsAlphaPixelFormat(frameBmap.PixelFormat))
throw new ApplicationException("The frame bitmap must be 32 bits per pixel with an alpha channel.");
(The initial test allows frameBmap to be null if backBmap isn't, but the following line will then throw a NullReferenceException).
|
|
|
|
 |
|
 |
When you want to use it for a SplashScreen for example (i.e. no controls, just an empty form except for the alphaFormTransformer, the user will be able to drag around the Form anyway, even if the CanDrag property is set to false. Just change one line inside of the LayeredFormMouseDown() function to this:
if (CanDrag && e.Button == MouseButtons.Left)
Works fine! Is this a bug? I actually can't see the CanDrag property being checked anywhere in the class!
|
|
|
|
 |
|
 |
Some kind of 9-grid sizing would absolutely rock, too...
|
|
|
|
 |
|
 |
I thought about it at some point. The challenge being with bitmaps resizing is a can of worms - at some scale it won't look good.
|
|
|
|
 |
|
 |
Hi Jeff. Your article was very helpful for my work, but I has been needed resizable window too. So, I implemented it. I can send you my sample project. Maybe it would useful not only for me .
|
|
|
|
 |
|
 |
Can we please have instructions on how to resize it?
thank you, and awesome code, really.
|
|
|
|
 |
|
 |
Hello.
I prepared my sample project for you. You can take it by link:
http://dominichenko.com/OSWebBrowser.zip
I had cutted all specific functionality from there and now here is just logic for transparent resizable window building. (So, don't be frightened of some empty methods and so on ).
It's very easy to make it resize with full redrawing, but with this not so optimal logic of creating transparent window it's very slow, so when resizing I'm drawing just inverted frame.
Don't hesitate to write me if you will have some questions.
P.S. Just open and build OSWebBrowser solution from archive.
--
Sincerely,
Maxim
|
|
|
|
 |
|
 |
Maxim I finally got around to looking at your resize additions - very cool
|
|
|
|
 |
|
 |
Hi.
Website seems to be down.
Can I download your additions somewhere else - I'd love to have a look at them!
|
|
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
 |
I've tried the above link. When I open the solution to build, the alphaform library is missing. i tried the original library from the article, but there seems to be some missing functions.
CLWPROGRAMMER
|
|
|
|
 |
|
 |
Ok finally had the chance to check the new version and the hiding works flawless, not to mention the new examples are very clear.
So far performance doesn't seem to much of a concern but i haven't done anything too big with it.
So i am wondering the following.
Lest assume a standard business app, you know some data manipulation and reporting, some charts here and there. Assuming computers with, lets say, single core cpu and 512mb ram running winXP. Would this library (or similar per pixel alpha blending) on top of windows forms be fast enough? How would it compare with WPF (and eye candy with it)?
(i am newish to .net in general)
Of course i don't expect an exact answer or anything like that, but maybe there where some folks around with first hand experience with either this (or similar per pixel alpha blending) and wpf and could share a couple of lines regarding performance.
Thanks in advance!
|
|
|
|
 |
|
 |
This component's usefullness is somewhat narrow. It just provides for non-standard window borders using bitmaps in a WinForms applicaton. For alpha composited controls and visual elements in general, WPF is the place to be.
|
|
|
|
 |
|
 |
Basically wondering if controls have to always be placed in transparent areas marked with a AFMarker instead of, lets say, put a button straight on top of part of the image?
|
|
|
|
 |
|
 |
No there is a tutorial for doing what you want in the full source download - see the Help/Tutorials directory.
|
|
|
|
 |
|
 |
Yeah i was using the same method as the one in your tutorial but after rereading i see my problem was the antialiasing on the inner edge of the image.
Crash-coursing Photoshop at the same time sorry :/
btw, is it ok if we also disable antialias for the outer edge of the background image? i double checked the tutorial but the only comment i found was to use antialiasing on inneredges if we wherent using another image as background. If i missed it or is otherwise implied i am sorry.
Thanks in advance!
|
|
|
|
 |