locked
How can I create bitmaps RRS feed

  • Question

  • Hi,
    Can someone recommend a program that I can use to create bitmaps that can be use on a form or is there an easy way to create one in VB. The reason why I ask, when I draw text and lines using form Graphics.DrawLine, DrawString, FillRectangle I get a lot of flicker when the information is updated. Thank you in advance.
    Regards,
    Ken
     
    Sunday, August 6, 2006 9:30 PM

Answers

  • I don'y know if making your own bitmaps will solve your problem

    or not, but if you want to do it in VB:

    Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

    Dim image As New Bitmap(100, 100)

    Dim gr As Graphics = Graphics.FromImage(image)

    gr.DrawRectangle(Pens.Blue, 10, 10, 80, 80)

    gr.Dispose()

    image.Save("C:\g.bmp", System.Drawing.Imaging.ImageFormat.Bmp)

    image.Dispose()

    End Sub

    End Class

    Monday, August 7, 2006 12:20 AM

All replies

  • to create bitmaps? use mspaint I guess.

     

    Sunday, August 6, 2006 9:49 PM
  • There are several help topics that address the problem of flicker in graphics.

    See:

    ms-help://MS.VSExpressCC.v80/MS.NETFramework.v20.en/dv_fxmclignrl/html/5192295e-bd8e-45f7-8bd6-5c4f6bd21e61.htm

    ms-help://MS.VSExpressCC.v80/MS.NETFramework.v20.en/dv_fxmclignrl/html/91083d3a-653f-4f15-a467-0f37b2aa39d6.htm

     

    Sunday, August 6, 2006 10:07 PM
  • I don'y know if making your own bitmaps will solve your problem

    or not, but if you want to do it in VB:

    Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

    Dim image As New Bitmap(100, 100)

    Dim gr As Graphics = Graphics.FromImage(image)

    gr.DrawRectangle(Pens.Blue, 10, 10, 80, 80)

    gr.Dispose()

    image.Save("C:\g.bmp", System.Drawing.Imaging.ImageFormat.Bmp)

    image.Dispose()

    End Sub

    End Class

    Monday, August 7, 2006 12:20 AM
  • Paint works well and importing the .bmp is strait forward. You need to consider your user's monitor/panel resolution. Bit Map drawing can look really nice but it takes many hours.

    What exactly are you trying to do? I have two tasks I'm working on. 1) Animated 3-D bit maps, 2) Graphing SPC Data. Actually, the SPC task is not mine but, I control the project. Maybe if you give us more information? I'd like to heard what others have to say about plotting data. Seems to me this would be a great subject and would cover what you're asking for.

    Monday, August 7, 2006 3:45 PM