|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Looking for an easy way to achive this problem.I'm looking for some tips and/or suggestions to this little task I've set myself. I've dug out a load of my old 8 bit stuff (old source code and graphics files, etc) and I've got a load of graphics that I need to view, so basically I'm wanting to write a vb app that can load a binary file, and read byte by byte, and display the bytes in a graphics box, so the graphics will show a 8 by 8 grid, with pixels on and off, based on the bytes that are being read in (I really hope this makes sense)... I can appreacite that a 8 by 8 char would be very small, so I was thinking of making the pixels about the size of a normal 8 size font on windows... If I have the principal building blocks, I'll be able to move foward and maybe do a 16 by 16 box, or 8 by 16, etc.... I'm just asking what is the best way to go about this, as I've never worked with pictures directly using VB, I can load a .bmp into a form, etc and use it that way, but not be able to manipulate it? Is it easy, or will it be a challenge? Regards Paul. I ~think~ I kinda understand. If I do understand correctly, each data byte
read in is just an indicator if the corresponding pixel is on or off. If so, you can accomplish this using a PictureBox and the PSet method. To simplify this example, I just used a 64 character string with each character being either a "1" (on) or "0" (off). And I hardcoded the string to indicate a little 8 x 8 box... Dim PixelMap As String ' Hardcode it as an 8x8 box PixelMap = "11111111" PixelMap = PixelMap & "10000001" PixelMap = PixelMap & "10000001" PixelMap = PixelMap & "10000001" PixelMap = PixelMap & "10000001" PixelMap = PixelMap & "10000001" PixelMap = PixelMap & "10000001" PixelMap = PixelMap & "11111111" Debug.Print PixelMap Picture1.ScaleMode = vbPixels Picture1.AutoRedraw = True Dim XX As Single, YY As Single, PP As Integer For YY = 0 To 7 For XX = 0 To 7 PP = PP + 1 If Mid$(PixelMap, PP, 1) = "1" Then Picture1.PSet (XX, YY), &HFF& ' red pixel Next XX Next YY Show quoteHide quote "Kardon Coupé" <prefer.to@readon.newsgroups> wrote in message news:eGJGdsFXHHA.1636@TK2MSFTNGP02.phx.gbl... > Dear All, > > I'm looking for some tips and/or suggestions to this little task I've set > myself. > > I've dug out a load of my old 8 bit stuff (old source code and graphics > files, etc) and I've got a load of graphics that I need to view, so > basically I'm wanting to write a vb app that can load a binary file, and > read byte by byte, and display the bytes in a graphics box, so the graphics > will show a 8 by 8 grid, with pixels on and off, based on the bytes that are > being read in (I really hope this makes sense)... > > I can appreacite that a 8 by 8 char would be very small, so I was thinking > of making the pixels about the size of a normal 8 size font on windows... > > If I have the principal building blocks, I'll be able to move foward and > maybe do a 16 by 16 box, or 8 by 16, etc.... > > I'm just asking what is the best way to go about this, as I've never worked > with pictures directly using VB, I can load a .bmp into a form, etc and use > it that way, but not be able to manipulate it? > > Is it easy, or will it be a challenge? > > Regards > Paul. > > On Thu, 1 Mar 2007 23:41:17 -0000, "Kardon Coupé"
<prefer.to@readon.newsgroups> wrote: Show quoteHide quote >Dear All, Been there !> >I'm looking for some tips and/or suggestions to this little task I've set >myself. > >I've dug out a load of my old 8 bit stuff (old source code and graphics >files, etc) and I've got a load of graphics that I need to view, so >basically I'm wanting to write a vb app that can load a binary file, and >read byte by byte, and display the bytes in a graphics box, so the graphics >will show a 8 by 8 grid, with pixels on and off, based on the bytes that are >being read in (I really hope this makes sense)... > >I can appreacite that a 8 by 8 char would be very small, so I was thinking >of making the pixels about the size of a normal 8 size font on windows... Always set your ScaleMode to vbPixels Have a look at the Line method - specifically Box Fill Also: PSet Ultimately you'll land up using the APIs SetPixel, FillRect etc "J French" <erew***@nowhere.uk> wrote He could use a lookup table that has images for the 256 different bit configurations.> >I'm looking for some tips and/or suggestions to this little task I've set > >myself. <...> > >I can appreacite that a 8 by 8 char would be very small, so I was thinking > >of making the pixels about the size of a normal 8 size font on windows... > > Ultimately you'll land up using the APIs > SetPixel, FillRect etc Here is an example that is oriented horizontally (instead of vertically like they would be in an 8-bit character map). Not quite the same, but enough to get an idea.... http://groups.google.co.uk/group/microsoft.public.vb.general.discussion/msg/853cb2c6db9d178a LFS On Fri, 2 Mar 2007 03:56:17 -0600, "Larry Serflaten"
<serfla***@usinternet.com> wrote: Show quoteHide quote > Very true - it reminds me of printing to two colour CGA screens>"J French" <erew***@nowhere.uk> wrote > >> >I'm looking for some tips and/or suggestions to this little task I've set >> >myself. ><...> >> >I can appreacite that a 8 by 8 char would be very small, so I was thinking >> >of making the pixels about the size of a normal 8 size font on windows... > >> >> Ultimately you'll land up using the APIs >> SetPixel, FillRect etc > >He could use a lookup table that has images for the 256 different bit configurations. >Here is an example that is oriented horizontally (instead of vertically like they >would be in an 8-bit character map). Not quite the same, but enough to get an idea.... >http://groups.google.co.uk/group/microsoft.public.vb.general.discussion/msg/853cb2c6db9d178a
Data Type String
Problems after installing Visual Basic 6 on XP Professional SP2 VB6 App Deployment in Vista OT - MS: $4,000 for Daylight Saving Fix Convert decimal to fraction string VB6 User Control next problem Autologon on Vista Random access file help Read/Write permission (earn your quarter, Karl!) Error '50003' Unspecified error in VB6 Program |
|||||||||||||||||||||||