IT Community - Software Programming, Web Development and Technical Support

.NET tricks & Tips

This is a discussion on .NET tricks & Tips within the VB.NET Programming forums, part of the Software Development category; Hi Here I am going to post the .NET tricks. Very useful one. You can also post your .NET tips ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > VB.NET Programming

Register FAQ Members List Calendar Mark Forums Read
  #1  
Old 04-13-2007, 05:15 AM
Karpagarajan Karpagarajan is offline
D-Web Analyst
 
Join Date: Mar 2007
Posts: 301
Karpagarajan is on a distinguished road
Thumbs up .NET tricks & Tips

Hi Here I am going to post the .NET tricks. Very useful one. You can also post your .NET tips here.

How to convert a Bitmap to a Byte Array

Here is some simple code that takes a bitmap and converts it to a byte array.

Dim myVar As MemoryStream = New MemoryStream Dim bitmapBytes As Byte()
'Create bitmap Dim bitmap As Bitmap = New Bitmap(50, 50)
bitmap.Save(myVar, System.Drawing.Imaging.ImageFormat.Jpeg)
bitmapBytes = myVar.ToArray
myVar.Close()
bitmap.Dispose()


thanks
__________________
Karpagarajan. R
Necessity is the mother of invention
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old 04-23-2007, 08:17 AM
Karpagarajan Karpagarajan is offline
D-Web Analyst
 
Join Date: Mar 2007
Posts: 301
Karpagarajan is on a distinguished road
Thumbs up Re: .NET tricks & Tips

Visual C++ .NET File Processing

File Processing in VC++.Net can be by using a class called FileStream. To process a file, declare the FileStream object and use it.

Here is the sample code
String *ListOfStates = S"StatesList";
FileStream *fsStates = new FileStream(ListOfStates, FileMode::Create);
StreamWriter *swStates = new StreamWriter(fsStates);

for(int i = 0; i < this->cboState->Items->Count; i++)
swStates->WriteLine(this->cboState->Items->get_Item(i));
swStates->Flush();
swStates->Close();

Close();
thanks
__________________
Karpagarajan. R
Necessity is the mother of invention
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
C# .Net Tips & Tricks oxygen C# Programming 85 01-08-2009 12:25 AM
SAP Tips & Tricks leoraja8 Operating Systems 0 03-29-2008 12:11 AM
PHP Tips and Tricks Sabari PHP Programming 20 12-18-2007 05:26 AM
SQL Server Tips & Tricks Venkat Database Support 16 09-24-2007 01:34 AM
SEO Tips & Tricks spid4r Search Engine Optimization 0 03-08-2007 11:03 PM


All times are GMT -7. The time now is 10:07 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.
Our Partners
One Way Moving Companies | Stamford Dentist | Euro Millions Lottery | Home Loans| Furniture

SEO by vBSEO 3.0.0