Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

create bitmaps

Posted on 2006-07-11
4
Medium Priority
?
232 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 1400 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 600 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 Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

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…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

604 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