Solved

create bitmaps

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
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…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

809 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