473,398 Members | 2,165 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

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.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. 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.FromImage(oBmp)
Dim gr1 As Graphics = Graphics.FromImage(finBmp)

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

Dim redBr As New SolidBrush(Color.Red)
Dim bgBr As New SolidBrush(Color.White)
Dim grbr As New SolidBrush(colbg)
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(arr)

gr.FillRectangle(bgBr, 0, 0, 100, 250)
gr.DrawLine(blackPen, New Point(0, 50), New Point(0, 225))
gr.DrawLine(blackPen, New Point(0, 225), New Point(95, 225))
gr.DrawLine(blackPen, New Point(0, 50), New Point(30, 5))
gr.DrawLine(blackPen, New Point(30, 5), New Point(75, 15))
gr.DrawLine(blackPen, New Point(95, 225), New Point(95, 80))
gr.DrawCurve(blackPen, curvePoints)
gr.FillPath(grbr, 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(blackPen, bknkpts)
'gpth.AddLines(bkpts)
'gr.FillPath(grbr, gpth)
gr.SmoothingMode = Drawing2D.SmoothingMode.Default

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

Response.ContentType = "image/gif"
finBmp.Save(Response.OutputStream, ImageFormat.Gif)
gr.Dispose()
gr1.Dispose()
oBmp.Dispose()
nBmp.Dispose()
finBmp.Dispose()

Jul 5 '06 #1
0 1030

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

Similar topics

4
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...
1
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...
0
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...
0
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...
10
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...
0
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...
4
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...
4
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...
2
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...
0
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...
0
BarryA
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...
0
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...
0
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...
0
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,...

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.