473,811 Members | 2,190 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Show borders on the graphics

Hello,

I have generated an image(T-Shirt). It was drawn using lines,
curves. After that I filled with
color(gr.fillpa th(greenBrush,g raphicsPath)). I used blackPen to draw
lines and curves with stroke 4. After filling the path, The whole image
is filled with color. Thats ok but i want to see the borders also.
Suppose I hv drawn body of the shirt. Next I need to attach collar and
sleeve those are drawn seperately and attached to body. Collar and
sleeve also same color of body. In this case I am not able to see
borders where the body ends, where is the collar, sleeve joinings...
coz the color is filled.

How can I see the borders?

This is my code for body. At the neck position, i need to fil color but
if I fill, i cant see the neck(V-neck/crew neck).

Dim finBmp As New Bitmap(200, 250)
Dim oBmp As New Bitmap(100, 250)
Dim nBmp As Bitmap
Dim gr As Graphics = Graphics.FromIm age(oBmp)
Dim gr1 As Graphics = Graphics.FromIm age(finBmp)

Dim text As String = textboxFromDate .Text
Dim colbg As Color = Color.FromName( text)

Dim redBr As New SolidBrush(Colo r.Red)
Dim bgBr As New SolidBrush(Colo r.White)
Dim grbr As New SolidBrush(colb g)
Dim blackPen As New Pen(Color.Black , 4)
Dim grPen As New Pen(Color.Green , 3)
Dim point1 As New Point(75, 15)
Dim point2 As New Point(76, 30)
Dim point3 As New Point(80, 50)
Dim point4 As New Point(85, 65)
Dim point5 As New Point(90, 75)
Dim pt5 As New Point(95, 80)
Dim curvePoints As Point() = {point1, point2, point3, point4,
point5, pt5}
Dim arr As Point() = {New Point(0, 50), New Point(0, 225), New
Point(95, 225), New Point(95, 80), New Point(90, 75), New Point(85,
65), New Point(80, 50), New Point(76, 30), New Point(75, 15), New
Point(75, 15), New Point(30, 5)}
Dim gpth As New GraphicsPath
gpth.AddLines(a rr)

gr.FillRectangl e(bgBr, 0, 0, 100, 250)
gr.DrawLine(bla ckPen, New Point(0, 50), New Point(0, 225))
gr.DrawLine(bla ckPen, New Point(0, 225), New Point(95, 225))
gr.DrawLine(bla ckPen, New Point(0, 50), New Point(30, 5))
gr.DrawLine(bla ckPen, New Point(30, 5), New Point(75, 15))
gr.DrawLine(bla ckPen, New Point(95, 225), New Point(95, 80))
gr.DrawCurve(bl ackPen, curvePoints)
gr.FillPath(grb r, gpth)

Dim bknkpts As Point() = {New Point(0, 10), New Point(10, 8),
New Point(20, 7), New Point(30, 5)}
'Dim bkpts As Point() = {New Point(0, 49), New Point(0, 11),
New Point(9, 9), New Point(21, 7), New Point(31, 6)}
gr.DrawCurve(bl ackPen, bknkpts)
'gpth.AddLines( bkpts)
'gr.FillPath(gr br, gpth)
gr.SmoothingMod e = Drawing2D.Smoot hingMode.Defaul t

nBmp = oBmp.Clone()
nBmp.RotateFlip (RotateFlipType .Rotate180FlipY )
gr1.DrawImage(n Bmp, 0, 0)
gr1.DrawImage(o Bmp, 100, 0)

Response.Conten tType = "image/gif"
finBmp.Save(Res ponse.OutputStr eam, ImageFormat.Gif )
gr.Dispose()
gr1.Dispose()
oBmp.Dispose()
nBmp.Dispose()
finBmp.Dispose( )

Jul 5 '06 #1
0 1051

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
8940
by: Konrad Viltersten | last post by:
As it isnow i have to use a syntax for my tables as: <table class = "some" border> and/or <table class = "some" noborder> Now, what i'd like to do is to make that border-thingy appear/desappear using javascript. Is it solvable that way? I tried to rely on CSS but i didn't find any good info on this matter...
1
5849
by: Glen Vermeylen | last post by:
Hi, For a project at school we have to automate the assignment of seats in classrooms to students during the exams. The lady who previously did everything manually kept the layouts of the classrooms in an excel-document: 1 sheet per classroom, and she marked the cells which represent the seats with a border. The problem however is that she sometimes merged cells together to get a better layout.
0
1529
by: Dr. Zharkov | last post by:
Hello. To see the graphics of technology DirectX 9.0 SDK Update - June 2005 in project Visual Basic, WindowsApplication1 from Visual Studio 2005 Beta 1, in file My Project, MyApplication.vb in a method: <Global.System.Diagnostics.DebuggerStepThrough()> _ Protected Overrides Sub OnCreateMainForm()
0
1250
by: M.A | last post by:
Hello, I'm joining multiple images to a whole one using Graphics classes DrawImage method. Unfortunately DrawImage leaves borders in those places where images are combined. How could I prevent this? I tried to first create a one big image with certaing backgroundcolor put Drawing images into it causes borders too. How to get rid of these borders?
10
45219
by: steve | last post by:
Hi All I would like to be able to change the cell borders on certain cells to none at runtime to make a group of cells appear to be merged I have tried the following in the cellformatting event..., to no avail Any ideas Regards
0
238
by: mrajanikrishna | last post by:
Hello, I have generated an image(T-Shirt). It was drawn using lines, curves. After that I filled with color(gr.fillpath(greenBrush,graphicsPath)). I used blackPen to draw lines and curves with stroke 4. After filling the path, The whole image is filled with color. Thats ok but i want to see the borders also. Suppose I hv drawn body of the shirt. Next I need to attach collar and sleeve those are drawn seperately and attached to body....
4
2761
by: Nathan Baker | last post by:
Hey, I am trying to subclass a button to create a control similar to the Firefox/IE dropdown button. My first step is to draw the 'down arrow' on the button. I overrided the OnPaint method thusly: protected override void OnPaintBackground(PaintEventArgs pevent) { base.OnPaintBackground(pevent); paintArrow(); }
4
2882
by: Martijn Mulder | last post by:
When I zoom in on an image, GDI+ automatically smoothens the edges between the pixels. I am looking for a way to see the individual pixels as squares in the enlarged image, like in MSPaint. I searched in vain in the enumerations System.Drawing.Drawing2D.SmoothingMode and System.Drawing.Drawing2D.InterpolationMode to find the constant that does just that. How? Some code to illustrate the problem: using System.Drawing;
2
30969
by: nicstel | last post by:
Hello, I'm trying to find documentation about the xlwt (py_excelerator). I want to change the border of some cells. But the only types that I found is: double and dashed. How to do a simple line and what is the all other border type name? "borders: top double, bottom double, left double, right double;" Thank You Nicolas
0
15253
by: ziketo | last post by:
Hi, I searched a lot about changing the DataGridView cell borders. BYTES helped me so I will write down the solution: 1. You should override the class DataGridViewTextBoxCell, and the new class should have a property of type DataGridViewAdvancedBorderStyle, this property you will change from the outside: 2. You will override also the PaintBorder, and Paint methods in a way that they will get the new property instead of the default one....
0
9728
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
10648
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
10135
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
9205
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
6890
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
5692
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4339
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3867
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3018
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.