![]() ![]() Make backColor transparent for myBitmap. Void MakeTransparent_Example2( PaintEventArgs^ e )Ĭolor backColor = myBitmap->GetPixel( 1, 1 ) Makes that color transparent for the bitmap. #Paint.net replace color with transparent code#The following code example is designed for use with Windows Forms, and it requires PaintEventArgs e, which is a parameter of the Paint event handler. When you call MakeTransparent, the bitmap will be converted to the Format32bppArgb format, as this format supports an alpha channel. If no transparent color is specified by the system, LightGray is the transparent color. This method makes the default transparent color transparent for this Bitmap. The system palette defines one color as the default transparent, or alpha, color. ' Draw the transparent bitmap to the screen.Į.Graphics.DrawImage(myBitmap, myBitmap.Width, 0, myBitmap.Width, _ ' Make the default transparent color transparent for myBitmap. ' Create a Bitmap object from an image file.Į.Graphics.DrawImage(myBitmap, 0, 0, myBitmap.Width, _ Private Sub MakeTransparent_Example1(ByVal e As PaintEventArgs) Private void MakeTransparent_Example1(PaintEventArgs e)īitmap myBitmap = new Bitmap("Grapes.gif") Į.Graphics.DrawImage(myBitmap, 0, 0, myBitmap.Width,Į.Graphics.DrawImage(myBitmap, myBitmap.Width, 0, Draw the transparent bitmap to the screen.Į->Graphics->DrawImage( myBitmap, myBitmap->Width, 0, myBitmap->Width, myBitmap->Height ) Make the default transparent color transparent for myBitmap. Create a Bitmap object from an image file.īitmap^ myBitmap = gcnew Bitmap( "Grapes.gif" ) Į->Graphics->DrawImage( myBitmap, 0, 0, myBitmap->Width, myBitmap->Height ) Void MakeTransparent_Example1( PaintEventArgs^ e ) The code makes the system default transparent color transparent for myBitmap, and then draws the Bitmap to the screen. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |