Solved

create bitmaps

Posted on 2006-07-11
4
223 Views
Last Modified: 2010-04-23
hi,
i need to create a bitmap image using vb.net? and give it a sigle color?
this will be a texture for a 3D object.
i that dooable??

thanks
0
Comment
Question by:mte01
  • 2
4 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 350 total points
ID: 17082158
Dim bmp as Bitmap
Dim g as Graphics

bmp = new Bitmap(width, height, PixelFormat.Format24bppRgb)
g = Graphics.FromImage(bmp)

' draw in graphics anything you need, for example:
Dim blueBrush As New SolidBrush(Color.Blue)
g.FillRectangle(blueBrush, 0, 0, width, height)

blueBrush.Dispose()
g.Dispose()

' use bmp
0
 
LVL 14

Assisted Solution

by:ptakja
ptakja earned 150 total points
ID: 17082367
If you just want a solid color as your bitmap background you can do this:

Dim bmp as Bitmap
Dim g as Graphics

bmp = new Bitmap(width, height, PixelFormat.Format24bppRgb)
g = Graphics.FromImage(bmp)

g.Clear(Color.Black)   '<<<<< Sets all the pixels in the bitmap to the color specified.

g.Dispose()

' use your bitmap here...
0
 
LVL 3

Author Comment

by:mte01
ID: 17082860
thanks a lot guys
u r the best :)
0
 
LVL 3

Author Comment

by:mte01
ID: 17082865
That worked...thanks for your help guys!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now