473,657 Members | 2,586 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Urgent: Working with a Circular Transparency

2 New Member
hi guys .. my team is working on an application where we have to have one image which is acting as the base of all the elements on the screen ... and this same image has a transparency in the center. now this centre transparency is supposed to display a picture which will be captured from a web cam.

currently everything working fine but the only problem which we are facing is that the picture is not proportionate to what is the actual resolution that it was shot at. it has been stretched from the top and bottom. the reason is that the imagebox which has been used to call this webcam display is a aquare.

now it seems that the team is not being able to use the exact proportions of the image to call it in the picturebox for a reason that the final image needs to be cropped to fit in a circle.

now how do we over come this problem? any idea???

in simple words, i have a rectangular image and i want to draw a circle over this image. whatever is within the circle should be visible, whatever is outside the circle should be transparent. (a mask needs to be created...)

but the only thing is that this circle will first display the image/video from the web camera and only once the picture is clicked, it should show the same picture within this circular area.

Please help, its urgent ... there is a client delivery and we have been trying to overcome this since last few days ...

thanks a lot
dAttitude
Attached Images
File Type: jpg Frame.jpg (6.7 KB, 169 views)
File Type: gif FinalResult.gif (54.2 KB, 158 views)
Aug 24 '09 #1
3 1690
tlhintoq
3,525 Recognized Expert Specialist
currently everything working fine but the only problem which we are facing is that the picture is not proportionate to what is the actual resolution that it was shot at. it has been stretched from the top and bottom. the reason is that the imagebox which has been used to call this webcam display is a aquare
That doesn't make sense. A square and a circle both have the same aspect ratio... 1:1 meaning their width is the same as their height. So if you are putting a circular template with transparency over a square image the aspect ratio shouldn't be going out of whack.

I would however be surprised to see a webcam with a square image. Many go up to 640x480 mimicing the ratio of the screens they might be viewed on. You can even get 720p widescreen webcams for under $100 now.


I suspect the real problem is that you aren't actually working with the image. Let me guess... You have a couple pictureboxes on top of one another so they *appear* to be one control. So if the picturebox with the webcam is set to "stretch" then it looks funny.

Am I right?
Aug 24 '09 #2
dAttitude
2 New Member
@tlhintoq
thats the point buddy, the camera will always give you a rectangular image. as i mentioned i am using a circle for the mask and my picturebox is square (my team is working on a picturebox which is squate, as it seems they can not mask the rectangular image with a perfect circular cropping. they are not really experienced on that part.) so we are looking at a solution where we can crop the rectangular picture (the resolution may be anything... may be even HD as we have a logitch pro 9000 camera to be used with the application.)

is there any way we can retain the resolution/aspect ratio of the captured image and implement the perfect circular cropping on that image to get the result like in the image???

thanks for the reply ....
Aug 25 '09 #3
tlhintoq
3,525 Recognized Expert Specialist
A) If the circle is to be filled, then you grab a subset of the rectangle and use it to fill the open space of the circle
B) If you want all of the rectangle then you will have blank space in the circle around your scaled-down rectangular image.

Sounds like you want a filled circle.
  • Receive 1 frame from the webcam
  • Scale the frame to match the height of your circle
  • Fill the circle with part of the frame (starting at the upper left for example)
  • Display the result
Aug 25 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
3688
by: Ming | last post by:
When I use fopen on the URL: fopen("http://home.pchome.com.tw/world/qoo4ko/110.jpg";, "r") I would get the following error message: -----------Error Message------------ Warning: fopen(): Circular redirect, aborting. Warning: fopen(http://home.pchome.com.tw/world/qoo4ko/110.jpg): failed to open stream: Permission denied ------------------------------------
0
1826
by: Kenny | last post by:
I yant to put transparency in an image without transparency and without having to create a new image. This mean that I wan to read an image from the disk and add some alpha in it. for now, I have private void createStdImage() { RenderedImage rImage = JAI.create("fileload", getName()); if (rImage instanceof PlanarImage)
20
4512
by: Nathan Sokalski | last post by:
I am trying to create graphics with GDI+ that include transparency. However, the transparency never seems to show up, even though my colors have an alpha value of 0. How can I generate a graphic that is completely transparent in certain areas (so that the web page background shows through)? I save my graphics as gif files. I would appreciate, if possible, a simple example so that I can see the code. Thanks. -- Nathan Sokalski...
5
1284
by: Shapper | last post by:
Hello, I just upload my web site to my hosting server and when I access it I always get an error: "Redicterion limit for this URL exceeded. Unable to load the requested page" Does anyone has any idea what is going on?
1
1060
by: Edwin Knoppert | last post by:
I have tried to convert transparent icons to transparent gif's. I'm not succesful. Could you check the (running) project and possibly give some corrections? I think i need to obtain both images and make my own loop. I have the feeling this code is not working as intended. The transparancy works but it strips desired pixels as well. Thanks.
4
2051
by: Ibrahim. | last post by:
Hi all, I want to display watermark images (transparent images) as background image for all my asp.net pages. when I open the pages I should see the transparent image. the server controls after rendering should be displayed normally on top of the transparent image. Thanks very much.
3
4184
by: atif | last post by:
Hi, When i use Transparency key with the parent form then its ok the form become Transparent but when i add another form to parent and sets the child form' transparency key it does not work at all.. child form never becomes transparent neither by transparency key nor by ChildForm.BackColor = Color.transparent.. Any Body Plzzzzzzzzz..
2
3657
by: irish10945 | last post by:
I have been using this great dynamic page flip from 76 design but I've run into some problems maybe someone can help me out with. I have about 70 pages in the book. I do not want people to have to wait for the entire book to load before looking at it. The code they have says that you can preload a couple of pages first and then have the rest load in the background but its not working correctly. Even though I tell the code false it still loads...
1
1725
by: zakk | last post by:
Please help! this is the website: http://www.mbg.ae/services.htm in the Services Drop-down menu in IE the transparency of the sub-menu is showing but when you check this on Firefox there's no transparency plus no fading effects. Please help. Thanks. Zakk
0
8392
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8823
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8730
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7321
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4151
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1950
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.