Solved

create bitmaps

Posted on 2006-07-11
4
222 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

758 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

20 Experts available now in Live!

Get 1:1 Help Now