'''' This code is part of Document Solutions for Imaging demos.'' Copyright (c) MESCIUS inc. All rights reserved.''ImportsSystemImportsSystem.IOImportsSystem.DrawingImportsSystem.LinqImportsGrapeCity.Documents.DrawingImportsGrapeCity.Documents.TextImportsGrapeCity.Documents.Imaging '' This sample loads the .ICO generated by the MakeIco sample,'' and renders all frames found in it along the diagonal of the'' resulting image.PublicClassReadIcoPublicFunctionGenerateImage(ByVal pixelSize AsSize,ByVal dpi AsSingle,ByVal opaque AsBoolean,OptionalByVal sampleParams AsString() = Nothing) AsGcBitmap Dim x AsInteger = 0, y AsInteger = 0 Dim srcPath = Path.Combine("Resources", "ImagesBis", "mescius-logomark-c.ico")Using bmp AsNewGcBitmap()Using ico AsNewGcIco(srcPath)Dim w = ico.Frames.Sum(Function(f) f.Width)Dim h = ico.Frames.Sum(Function(f) f.Height) bmp.CreateImage(w, h, False) bmp.Clear()For i AsInteger = 0To ico.Frames.Count - 1Using tbmp = ico.Frames(i).ToGcBitmap() bmp.BitBlt(tbmp, x, y) x += tbmp.PixelWidth y += tbmp.PixelHeightEndUsingNextReturn bmp.Clip(NewRectangle(0, 0, x, y))EndUsingEndUsingEndFunctionEndClass