Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. how to set bmp format setting??VB.net

how to set bmp format setting??VB.net

Scheduled Pinned Locked Moved Visual Basic
csharpgraphicshelptutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MJay
    wrote on last edited by
    #1

    i set variable as a bitmap buffer dim bufferBmp As Bitmap Dim myfont As Font = New Font(New FontFamily("Arial"), 8, FontStyle.Regular) when i use drawstring on the bitmap and display it on a picbox g.DrawString("Start", myfont, mysolidbrush, startdrawx, d) the output of the string seems like become bolded and unclear, it will never happen when i draw directly on the picturebox, i need to use bitmap buffer due to certain reasons, somebody suggested me set the pixel format of the bmp using Format32bppArgb or Format32bppPArgb. but i really a beginner in VB.Net, anyone can provide me the sample coding to set the format?? thanks for any help!!

    D 1 Reply Last reply
    0
    • M MJay

      i set variable as a bitmap buffer dim bufferBmp As Bitmap Dim myfont As Font = New Font(New FontFamily("Arial"), 8, FontStyle.Regular) when i use drawstring on the bitmap and display it on a picbox g.DrawString("Start", myfont, mysolidbrush, startdrawx, d) the output of the string seems like become bolded and unclear, it will never happen when i draw directly on the picturebox, i need to use bitmap buffer due to certain reasons, somebody suggested me set the pixel format of the bmp using Format32bppArgb or Format32bppPArgb. but i really a beginner in VB.Net, anyone can provide me the sample coding to set the format?? thanks for any help!!

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      You might want to try creating your Bitmap object using the Grpahics object of the PicBox.

      Dim grPicBox as Graphics = PicBox.CreateGraphics()
      Dim bufferBmp As New Bitmap(Width, Height, grPicBox)
      

      This will give your Bitmap the same PixelFormat as the PicBox. The only down side is you have to give the Width and Height of the buffer. RageInTheMachine9532

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups