Click here to Skip to main content
15,917,005 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionVB6 clickable label Pin
tatchung15-Jul-08 21:35
tatchung15-Jul-08 21:35 
AnswerRe: VB6 clickable label Pin
Zaegra15-Jul-08 21:44
Zaegra15-Jul-08 21:44 
GeneralRe: VB6 clickable label Pin
tatchung15-Jul-08 22:06
tatchung15-Jul-08 22:06 
QuestionReports are not visible at client machine Pin
meetaqadir15-Jul-08 20:56
meetaqadir15-Jul-08 20:56 
AnswerRe: Reports are not visible at client machine Pin
_Damian S_16-Jul-08 16:40
professional_Damian S_16-Jul-08 16:40 
QuestionSaving Bitmap to WBMP Pin
threemp315-Jul-08 19:14
threemp315-Jul-08 19:14 
AnswerRe: Saving Bitmap to WBMP Pin
Luc Pattyn16-Jul-08 0:18
sitebuilderLuc Pattyn16-Jul-08 0:18 
GeneralRe: Saving Bitmap to WBMP Pin
threemp316-Jul-08 13:04
threemp316-Jul-08 13:04 
Thanks, I've fixed the errors and found more.
I thought I'd post the fixed source code in case someone else finds it useful.

Dim fs As System.IO.FileStream = System.IO.File.OpenWrite(newFilename)
Dim img As Bitmap = Image.FromFile(filename)

' Write Header
fs.WriteByte(0)
fs.WriteByte(0)
fs.WriteByte(img.Width)
fs.WriteByte(img.Height)

' Convert colour to 1bit and packet bits into byte
Dim iByte As Byte = 0
Dim iCurrentBit As Integer = 7
For y As Integer = 0 To img.Height - 1
    For x As Integer = 0 To img.Width - 1

        Dim clr As Color = img.GetPixel(x, y)
        If (clr.R > 128) And (clr.G > 128) And (clr.B > 128) Then
            iByte = iByte Or (1 << iCurrentBit)
        End If

        If (x >= img.Width - 1) And (x Mod 8) Then
            fs.WriteByte(iByte)
            iByte = 0
            iCurrentBit = 7
        ElseIf iCurrentBit = 0 Then
            fs.WriteByte(iByte)
            iByte = 0
            iCurrentBit = 7
        Else
            iCurrentBit -= 1
        End If

    Next
Next

fs.Close()

GeneralRe: Saving Bitmap to WBMP Pin
Luc Pattyn16-Jul-08 13:19
sitebuilderLuc Pattyn16-Jul-08 13:19 
QuestionPlay .pps / .ppt file without installing MS Office Powerpoint Pin
divyesh143215-Jul-08 18:09
divyesh143215-Jul-08 18:09 
QuestionRe: Play .pps / .ppt file without installing MS Office Powerpoint Pin
Paul Conrad16-Jul-08 4:39
professionalPaul Conrad16-Jul-08 4:39 
AnswerRe: Play .pps / .ppt file without installing MS Office Powerpoint Pin
Thomas Stockwell16-Jul-08 4:48
professionalThomas Stockwell16-Jul-08 4:48 
GeneralRe: Play .pps / .ppt file without installing MS Office Powerpoint Pin
Paul Conrad16-Jul-08 4:50
professionalPaul Conrad16-Jul-08 4:50 
QuestionEfficiently resizing an image with a pixel resize Pin
jacobjordan15-Jul-08 10:59
jacobjordan15-Jul-08 10:59 
AnswerRe: Efficiently resizing an image with a pixel resize Pin
Luc Pattyn15-Jul-08 11:18
sitebuilderLuc Pattyn15-Jul-08 11:18 
GeneralRe: Efficiently resizing an image with a pixel resize [modified] Pin
jacobjordan15-Jul-08 12:37
jacobjordan15-Jul-08 12:37 
GeneralRe: Efficiently resizing an image with a pixel resize Pin
Luc Pattyn15-Jul-08 13:21
sitebuilderLuc Pattyn15-Jul-08 13:21 
GeneralRe: Efficiently resizing an image with a pixel resize Pin
jacobjordan15-Jul-08 13:25
jacobjordan15-Jul-08 13:25 
GeneralRe: Efficiently resizing an image with a pixel resize Pin
Luc Pattyn15-Jul-08 13:50
sitebuilderLuc Pattyn15-Jul-08 13:50 
GeneralRe: OnPaint Pin
Luc Pattyn15-Jul-08 15:05
sitebuilderLuc Pattyn15-Jul-08 15:05 
GeneralRe: Efficiently resizing an image with a pixel resize Pin
Luc Pattyn15-Jul-08 17:32
sitebuilderLuc Pattyn15-Jul-08 17:32 
Questiontreeview problem Pin
Member 226047315-Jul-08 10:31
Member 226047315-Jul-08 10:31 
AnswerRe: treeview problem Pin
Mr.PoorEnglish15-Jul-08 11:01
Mr.PoorEnglish15-Jul-08 11:01 
GeneralRe: treeview problem Pin
Member 226047315-Jul-08 16:13
Member 226047315-Jul-08 16:13 
GeneralRe: treeview problem Pin
Zaegra15-Jul-08 21:55
Zaegra15-Jul-08 21:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.