Solved

create bitmaps

Posted on 2006-07-11
4
228 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

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…
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…

707 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