I have a square picture. I need to draw a circle on it, and everything
outside that circle to be set to a certain color, so the image looks framed
On other words, I want to crop a circle form a rectangular picture
Any hints? 4 13784
If it's a not huge image and it's not an old computer, the
straight forward solution is just to run over the picture
and compare pixel by pixel. Like the pseudocode here:
ry = heightInNbrOfPixels / 2
ry = widthInNbrOfPixels / 2
rSqr = min(heightInNbrOfPixels ,widthInNbrOfPixels) * _
min(heightInNbrOfPixels ,widthInNbrOfPixels)
for y = 1 to heightInNbrOfPixels
for x = 1 to widthInNbrOfPixels
if y*y + x*x > rSqr then _
setPixel(x,y) = white
next x
next y -----Original Message----- I have a square picture. I need to draw a circle on it,
and everythingoutside that circle to be set to a certain color, so the
image looks framed On other words, I want to crop a circle form a
rectangular picture Any hints?
.
I havent looked, but when you do this on most graphics editors, you can fill
the area outside the circle, have you looked thru the libraries ( you
probably have, but just checking )
OHM
Crirus wrote: I have a square picture. I need to draw a circle on it, and everything outside that circle to be set to a certain color, so the image looks framed
On other words, I want to crop a circle form a rectangular picture
Any hints?
Hi Crirus,
Draw a circle with a very, very wide brush.
Regards,
Fergus
"Andreas Lundgren" <d9****@efd.lth.se> scripsit: I have a square picture. I need to draw a circle on it, and everything outside that circle to be set to a certain color, so the image looks framed On other words, I want to crop a circle form a
rectangular picture
Create an appropriate 'Region' from a 'GraphicsPath' and assign it to
the 'Graphics' object's 'Clip' property. Then draw the image onto the
canvas (filled with a solid brush before).
--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet> This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Doug van Vianen |
last post by:
Although I have programmed for several decades I am new to Java. I decided
to learn it to create Applets to use in web pages I make as a volunteer in
the computer club at a seniors' centre.
My...
|
by: Kevin Smith |
last post by:
Is there a way to "auto-crop" an image in PIL? I have some PNG images
with white backgrounds that I want cropped to show only the non-white
portion in the center, but I don't see how I can do...
|
by: Ranman |
last post by:
Hi all,
I have a simple problem that hopefully has a simple solution, but I
have yet to figure it out. In a patient database, I have a physician
test order form that populates a report that is...
|
by: ACaunter |
last post by:
Hi there,
I was wondering if there was a way to crop a peice of an ASP.Net Image,
allowing the user to zoom in on only a section of the picture??
any help would be appreciated!!
thanks
--...
|
by: Andreas Viklund via DotNetMonster.com |
last post by:
Hi!
I am developing an application in ASP.NET that takes an image, that have
been created with a digital camera or camera phone, and processes it, to
get data from it. The image taken by the user...
|
by: DMCD |
last post by:
I want to allow my program users to:
1. Open a jpg inside of a panel control
(PictureBox control inside Panel control ... PictureBox picture set to
user's jpg file selection);
2. Zoom in and...
|
by: Baron Samedi |
last post by:
Every so often, I see someone wanting to prevent heir images being
downloaded and the general consensus is "you can't".
Now a friend has asked me to think some more about this, and I think
that...
|
by: watashi |
last post by:
Hello,
I have 3 things to consider here, one is source image, form and picture box.
My picture or image on the form must be proportional in size to the original image.This image on form...
|
by: Thekid |
last post by:
Hi, I have an image similar to a clock, with numbers and letters going around in a circle. I need to extract the numbers and letters from the image and have them print out in a straight line and in...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
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,...
|
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...
|
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...
|
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,...
| |