|
Hi dear
Can you recognition coordinate of circle in bitmap?
i searching a algorithm for do this task but i cann't find
I want search a sample picture in another picture .
for example I give a circle picture to program then program search this picture in another picture ,if find get me coordinate of circle picture.
Thank
|
|
|
|
|
I was wondering if there was a way to get the same functionality using direct X. I see how you can use alpha blending for 3d objects, but how would you do it for a 2d png image and the desktop?
#teve
|
|
|
|
|
Since you called it "Form" (PerPixelAlphaForm) shouldn't we be able to add controls to it like labels and stuff?
Right now its only use seems to be the display of pictures over the desktop with full alpha support which is good, but rather limiting.
Is there any other project which implements full alpha support as a form background?
Luís Ferrão
|
|
|
|
|
Alpha blend windows don't support controls, so I don't support them either.
Not that I'm aware of, but feel free to implement it yourself and share it with us!
----
Rui Lopes
|
|
|
|
|
Actualy i did, by seemlessly creating another form on top of yours with a transparency key. The later form works as a placeholder for every control. The result is close to perfect but with only one issue:
If the user clicks outside a control on the top form, it activates your form. I can't find a way to avoid mouse clicking getting the focus to your form.
I do try to catch the mouse click event but when I do so, it's already too late as the background form already got the focus.
There is also another strange behaviour to your form. I have a form that inherits from yours. If i set the "ShowInTaskBar" to false, it actualy hides the entire form!
The workaround I found is to set it to false directly in the PerPixelForm constructor.
Thank god, code-project and yourself I have the source code =P
Luis Ferrao
|
|
|
|
|
basically...if you set the owner of the new form to the transparent form, i've found that it works like you want it to
|
|
|
|
|
Can you please post an example?
I'm a little new to all this and I'm not understanding what you mean. For example, I tried making a PerPixelAlphaForm and then another form with all my controls on it and then using Controls.Add() to add that form as a control onto the PerPixelAlphaForm but I got an exception
I would really like to know how to make a fully functional form with standard control on it where the background to the form is perpixelalphablended with the desktop.
Is this possible with C#?
|
|
|
|
|
Ya I'll tell ya how to do it.
Create a form based on the perpixelalphablended deal and load it up with your background png.
Next create another dummy form. Make this form the exact same size as the perpixelalpha form. Add all the controls that you want on top of this dummy form.
Now, in the contstructor of your dummy form create a region that specifies all the areas where you controls are and set it to the form like shown below.
<br />
public Form1()<br />
{<br />
System.Drawing.Drawing2D.GraphicsPath p = new System.Drawing.Drawing2D.GraphicsPath();<br />
<br />
p.AddRectangle(new Rectangle(0,0, 803, 24));
p.AddRectangle(new Rectangle(53, 122, 60, 40));
<br />
this.Region = new Region(p);<br />
}<br />
OR the other way... NOT using Regions. Make your dummy form a nice color like 255,0,255 and then set the transparency key to 255,0,255 also. This will work better than regions actually, because when you move your form you wont see the ugly dialog background color behind the controls.
Then position your dummy form exactly over top of your perpixel form. Then write some funky code to move each form at the same time when dragged.
If someone has a better way to it (I doubt it), then I CHALLENGE you to post the code here.
To move the windows simultaneously was easier than I thought. Gotter going perfectly. Keep checking www.clubdjpro.com for the DJRipper. Then you will see what it is capable of.
Then yer all good.
Cheers,
Greg
-- modified at 12:50 Tuesday 24th October, 2006
|
|
|
|
|
i have been messing around with your code for a whole day now and i still cant do i want.
i am trying to get the output of your code to go into a panel background, that way i can have a transparent alpha blended background and still have labels and stuff on it that are set to transparent so that the background can be seen.
Ive tried but i am new to this area of .net
That and i am implementing your code into a vb.net project
Thanks
Goran
|
|
|
|
|
i complete the work but i have a problem when i minimize the main form the others form not minimize
if i make it minimize i can't make all of them maximize the main form only will be max. and the others with not appear
MAZRO3
|
|
|
|
|
Hi,
Is there anyone who can guide me to create slices of an image? Well, let me explain in more detials. I have an image and I want to cut that into three pieces (I dont want to loose quality).
Any idea will be highly appreciated.
Thanks,
|
|
|
|
|
When I F5'd the sample (I'm natively a VB programmer and that's what we do), sometimes the window would be arbitrarily clipped so that not all the image was visible. And this was a fairly random occurrence. Has anyone else noticed this behavior?
Also, with the XP theming on, an image that bleeds to the edge would show the curved edges of the top of the window. Probably not what you want.
I think that I have found a solution. If you use the Win32 api function SetParent to set the window's parent to the desktop, both of these unusual behaviors disappear.
Gary Christopher Mann
Computer Science Undergraduate
Georgia Institute of Technology
Atlanta GA, 30332
'The MIT of the South, or is MIT the Georgia Tech of
the North'?
|
|
|
|
|
I am having the same problem with some of my own png's as well as the 'veggie' sample. Tried setting the parent to the desktop to no aval.
TestForm = new MyPerPixelAlphaForm();
TestForm.Parent = null ;
Win32.SetParent(TestForm.Handle,(IntPtr) 0) ;
TestForm.Show();
Oh well, guess I'll come back to it after dinner.
Tom
|
|
|
|
|
I saw that problem too.
What worked for me was setting the following in my PerPixelAlphaForm subclass' constructor:
this.Width = m_background.Size.Width;
this.Height = m_background.Size.Height;
Where m_background is the Bitmap image.
-J
|
|
|
|
|
The problem was related to the FormBorderStyle not being FormBorderStyle.None.
This article should update soon, in the meantime get the source here.
----
Rui Lopes
|
|
|
|
|
my mouse always through the window.
You demo window can not get the "hit test" message.
sorry, my English is very poor.
|
|
|
|
|
You may want to make sure that the size of your form is the size of the bitmap.
this.width = bitmap.width ;
this.height = bitmap.height ;
There are definitely mouse issues (hitting the window underneath) if you don't do this.
Tom
|
|
|
|
|
Rui,
I used your code as the basis for a per pixel alpha demo in my tutorial at:
http://www.codeproject.com/cs/media/CsTranspTutorial3.asp
I was fascinated by your demo, but I didn't know enough to make any use of it, so I did a study that lead to my three transparency tutorials, and got to where I think I understand what you are doing just enough to be dangerous.
The per pixel alpha transparency demo comes up with a bottle of Aqua Mala water (guaranteed 90% pure) that can be dragged around the desktop and has a mouse sensitive 'button'. I really got a kick out of programming this little demo.
Thanks for getting me started in transparency.
Joe
|
|
|
|
|
Where might I find an example of this, but using vb.net? I know the code is very similar but I have had no luck porting the code. Please help! This is exactly what I need to use and I have not found another example like this!!
|
|
|
|
|
Andrew,
You shouldn't need to port the code. As Rui mentions in his article, all you need to do to use his code is derive your form from the PerPixelAlphaBlend class. In .NET, you can derive a VB form from a C# class, no problem. So you don't need to port this code at all.
~Steve
|
|
|
|
|
noob here!!! how would you do that??
|
|
|
|
|
...since the System.Drawing already comes along with built in functions, which are not well commented but available to everyone, and work by means of HW accelerated blitting, thus decently fast.
But great article though; just wanna let u know!
|
|
|
|
|
Humm, System.Drawing alone? You have to show me how you do it!
----
Rui Lopes
|
|
|
|
|
bloodyduke wrote:
But great article though; just wanna let u know!
What article, this is purely a code sample.
Yes, I program in VB6, but only because I use it to fill my addiction to having a dry place to sleep and food to eat!
|
|
|
|
|
after the image is dragged around
the screen it becomes a simple form.
other then this, AMAZING stuff !
Michael
|
|
|
|