I am trying to create an image to put in a cell of the C1flexgrid
control. There isn't an image already there to get and draw on. I
would like to create a graphics object and draw the parts on it that I
want, then convert the graphic to an image to put into the cell. Here
is something I am trying but am getting errors with it:
Here I am just trying to get the procedure down for creating the image
before I start messing with trying to put it into the grid cell.
'***** CODE STARTS HERE *****
Dim NewFont As New Font(fg.Font.FontFamily, fg.Font.Size / 2,
FontStyle.Regular)
Dim pic As Bitmap = New Bitmap(box.Width, box.Height _
, Imaging.PixelFormat.Format24bppRgb)
g = Graphics.FromImage(pic)
g.SmoothingMode = SmoothingMode.AntiAlias
g.DrawString("H", NewFont, Brushes.Blue, 0, 0)
Dim st As System.IO.Stream
pic.Save(st, System.Drawing.Imaging.ImageFormat.Bmp)
Dim img As Image = Image.FromStream(st)
'**** END OF CODE ****
I keep getting told that st is nothing when I try to save to it, but
this a must inherit object.
Am I missing the boat completely here?
Kalvin