Welcome Guest! You need to login or register to make posts.



Go to last post Go to first unread
#1 Posted : Friday, November 11, 2005 5:33:46 PM(UTC)

Rank: Member

Groups: Member
Joined: 11/11/2005(UTC)
Posts: 1

Before purchasing this component, I would like to know if it's possible to design rounded squares or rounded rectangles and add a drop shadow over the generated image.
I ve attached an example of what I would like to do.
Thanks for your help
SSR attached the following image(s):
#2 Posted : Friday, January 06, 2006 12:28:05 PM(UTC)

Rank: Advanced Member

Groups: Member, Administration
Joined: 8/2/2003(UTC)
Posts: 865

Thanks: 2 times
Was thanked: 25 time(s) in 25 post(s)
Graphics Mill does not have rounded rectangle functionality, however perhaps you could emulate it with lines and bezier curves, or polygons.

E.g. here is a code sample how to draw rounded rectangle.

Dim objBitmap 
Dim objGraphics

Set objBitmap = Server.CreateObject("GraphicsMill.Bitmap")
objBitmap.CreateNew 640, 480

Set objGraphics = objBitmap.Graphics

objGraphics.Engine = 1

' Parameters
Dim x, y, width, height, roundness

x = 40
y = 30
width = 450
height = 100 
roundness = 40
Dim line1x1, line1y1, line2x1, line2y1, line3x1, line3y1, line4x1, line4y1
Dim line1x2, line1y2, line2x2, line2y2, line3x2, line3y2, line4x2, line4y2
Dim horend, vertend
horend = width * roundness/200
vertend = height * roundness/200

line1x1 = x 
line1y1 = y + vertend
line1x2 = x 
line1y2 = y + height - vertend

line2x1 = x + horend
line2y1 = y + height
line2x2 = x + width  - horend
line2y2 = y + height 

line3x1 = x + width 
line3y1 = y + height - vertend
line3x2 = x + width 
line3y2 = y + vertend

line4x1 = x + horend
line4y1 = y 
line4x2 = x + width - horend
line4y2 = y 

objGraphics.DrawLine line1x1, line1y1, line1x2, line1y2
objGraphics.DrawLine line2x1, line2y1, line2x2, line2y2
objGraphics.DrawLine line3x1, line3y1, line3x2, line3y2
objGraphics.DrawLine line4x1, line4y1, line4x2, line4y2

objGraphics.DrawBezier line1x1, line1y1, x, y, x, y, line4x1, line4y1
objGraphics.DrawBezier line1x2, line1y2, x, y + height, x, y + height, line2x1, line2y1
objGraphics.DrawBezier line2x2, line2y2, x + width, y + height, x + width, y + height, line3x1, line3y1
objGraphics.DrawBezier line3x2, line3y2, x + width, y, x + width, y, line4x2, line4y2

objBitmap.SaveToStream Response

Hope this helps.

Edited by user Sunday, December 23, 2007 4:40:26 PM(UTC)  | Reason: Not specified

Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.