how to set bmp format setting??VB.net
-
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 picboxg.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!! -
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 picboxg.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!!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