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

Notification

Icon
Error

Options
Go to last post Go to first unread
NormanL  
#1 Posted : Wednesday, June 20, 2012 10:02:14 AM(UTC)
NormanL

Rank: Advanced Member

Groups: Member
Joined: 4/26/2012(UTC)
Posts: 36

Thanks: 6 times
Hi,

Is it possible to hide the scroll bars in the (Ajax Controls) Canvas Viewer?

Is it possible to give the (Ajax Controls) Canvas viewer rounded corners?

Is it possible to add an outline effect to text in a vector text block (please see attached - note blue outline around red text)?

Many thanks
NormanL attached the following image(s):
text.gif
Dmitry.Obukhov  
#2 Posted : Wednesday, June 20, 2012 11:52:51 PM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

Groups: Member
Joined: 5/29/2010(UTC)
Posts: 1,310

Thanks: 8 times
Was thanked: 111 time(s) in 111 post(s)
Hello Norman,

Quote:
Is it possible to hide the scroll bars in the (Ajax Controls) Canvas Viewer?

You can set ScrollBar to "Auto" value. In this case scroll bars will be hidden if work space's height/width are smaller than height/width of canvasViewer.
Quote:
Is it possible to give the (Ajax Controls) Canvas viewer rounded corners?

Unfortunately GM support rectangle canvasViewer only.
Quote:
Is it possible to add an outline effect to text in a vector text block (please see attached - note blue outline around red text)?

Please read Drawing Text with Effects for more information.
Best regards,
Dmitry Obukhov
Technical Support. Aurigma, Inc.
NormanL  
#3 Posted : Thursday, June 21, 2012 7:58:55 AM(UTC)
NormanL

Rank: Advanced Member

Groups: Member
Joined: 4/26/2012(UTC)
Posts: 36

Thanks: 6 times
Hi Dmitry,

Many thanks for the reply. Regarding outlining of text that's what I was looking for, although my requirement is to add outlined text to my canvas, similar to adding regular text using TextVObjects. Using the reference you directed me to I did the following (please see below) where I created a bitmap and used that as the basis for an ImageVObject which I added to the canvas. Is this the correct approach (or is it possible to achieve similar results using TextVObjects)?

Code:
Dim lyr As Aurigma.GraphicsMill.AjaxControls.VectorObjects.Layer = CanvasViewer1.Canvas.Layers(0)
Dim bitmap As New Aurigma.GraphicsMill.Bitmap(Aurigma.GraphicsMill.RgbColor.Transparent, 320, 100, Aurigma.GraphicsMill.PixelFormat.Format32bppArgb)

Dim path As New System.Drawing.Drawing2D.GraphicsPath
path.AddString("Sample text", New System.Drawing.FontFamily("Arial"), 0, 50, New System.Drawing.PointF(20, 20), System.Drawing.StringFormat.GenericDefault)

Dim graphics As System.Drawing.Graphics = bitmap.GetGdiplusGraphics()
graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias

Dim brush As New System.Drawing.SolidBrush(System.Drawing.Color.Yellow)
graphics.FillPath(brush, path)

Dim pen As New System.Drawing.Pen(System.Drawing.Color.Red, 2)
graphics.DrawPath(pen, path)

Dim img As New Aurigma.GraphicsMill.AjaxControls.VectorObjects.ImageVObject(bitmap, True)
img.SupportedActions = Aurigma.GraphicsMill.AjaxControls.VectorObjects.VObjectAction.Drag + Aurigma.GraphicsMill.AjaxControls.VectorObjects.VObjectAction.Rotate
img.Location = New Aurigma.GraphicsMill.AjaxControls.VectorObjects.Math.PointF(350, 350)

lyr.VObjects.Add(img)


The method above works ok but I have the following questions:
In line 2 I have had to set the initial size of the bitmap (to 320x100) - is there anyway to automatically size the image to fit the text that's added (i.e. I'd like it to appear just like a TextVObject which scales to fit the text?)
Also what relation does the the FontSize attribute [i.e. emSize 50] have to pixel size? For example, if I save the bitmap to file (i.e. bitmap.Save(...)) I note the resulting image is 320x100px but what size (in px?) is the text?

Thanks

Edited by user Thursday, June 21, 2012 8:00:03 AM(UTC)  | Reason: Not specified

Dmitry.Obukhov  
#4 Posted : Monday, June 25, 2012 2:11:43 AM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

Groups: Member
Joined: 5/29/2010(UTC)
Posts: 1,310

Thanks: 8 times
Was thanked: 111 time(s) in 111 post(s)
Hello Norman,

Quote:
In line 2 I have had to set the initial size of the bitmap (to 320x100) - is there anyway to automatically size the image to fit the text that's added (i.e. I'd like it to appear just like a TextVObject which scales to fit the text?)

Unfortunately this is not possible.

Quote:
Also what relation does the the FontSize attribute [i.e. emSize 50] have to pixel size? For example, if I save the bitmap to file (i.e. bitmap.Save(...)) I note the resulting image is 320x100px but what size (in px?) is the text?

The System.Drawing.Font class is used to draw text on a bitmap. This class uses points for measuring font size. To calculate how many pixels font is, you should use this formula:
Code:
pixels = points * DPIofImage / 72

Edited by user Monday, June 25, 2012 2:17:24 AM(UTC)  | Reason: Not specified

Best regards,
Dmitry Obukhov
Technical Support. Aurigma, Inc.
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.