'''' This code is part of Document Solutions for Imaging demos.'' Copyright (c) MESCIUS inc. All rights reserved.''ImportsSystem.IOImportsSystem.DrawingImportsSystem.Collections.GenericImportsSystem.LinqImportsGrapeCity.Documents.DrawingImportsGrapeCity.Documents.TextImportsGrapeCity.Documents.ImagingImports GCTEXT = GrapeCity.Documents.Text '' This sample uses the same code as in the HelloWorld sample'' to create an image with the "Hello, World!" text, but in addition'' adds company logo copied from the MESCIUS home page'' using DsHtml.'''' Please see notes in comments at the top of HelloWorldHtml'' sample code for details on adding DsHtml to your projects.PublicClassGcLogoHtmlFunctionGenerateImage(ByVal pixelSize AsSize,ByVal dpi AsSingle,ByVal opaque AsBoolean,OptionalByVal sampleParams AsString() = Nothing) AsGcBitmap '' MESCIUS home page:Dim uri = New Uri("https://developer.mescius.com/")'' The coordinates of the logo on the home page:Dim logoRc = NewRectangleF(5, 5, 350, 80) '' Create the "Hello, World!" image like in the HelloWorld sample:Dim blue = Color.FromArgb(&HFF2E4884)Dim bmp = NewGcBitmap(pixelSize.Width, pixelSize.Height, True, dpi, dpi)Using g = bmp.CreateGraphics(blue)Dim rc = NewRectangleF(0, 0, pixelSize.Width, pixelSize.Height)Dim b = NewRadialGradientBrush(Color.White, blue, NewPointF(0.5F, 0.5F), True) g.FillRectangle(rc, b)Dim tf = NewTextFormatWith { .Font = GCTEXT.Font.FromFile(Path.Combine("Resources", "Fonts", "FreeSerifBold.ttf")), .FontSize = 64, .ForeColor = Color.OrangeRed } g.DrawString("Hello, World!", tf, rc, TextAlignment.Center, ParagraphAlignment.Center, False) '' Copy and paste the logo from onto the image, scaled x2:Dim fmt = NewHtmlToImageFormat(False, False) With { .Clip = logoRc, .Scale = 2 }'' Create an instance of GcHtmlBrowser that is used to render HTML:Using browser = Util.NewHtmlBrowser()Dim s AsSizeF g.DrawHtml(browser, uri, pixelSize.Width - logoRc.Width * fmt.Scale, 0, fmt, s)EndUsingEndUsingReturn bmpEndFunctionEndClass