Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#66616 - 04/02/2002 12:06 Loading the RAW or PNG screen dump into VB
Fastrack
member

Registered: 29/10/2001
Posts: 137
Loc: Toronto, Ontario Canada
Has anyone tried loading either of these 2 formats into Visual Basic?

I'm creating a remote control app in VB and want to use the screen dump from Mark Lords Hijack.

I may have to switch to MFC to code this, but I'd prefer VB

Thanks in advance.
_________________________
Ben Rio Car 10GB + 60GB Toshiba ([green]Green[/green]) - Serial # 30102833

Top
#66617 - 04/02/2002 21:16 Re: Loading the RAW or PNG screen dump into VB [Re: Fastrack]
number6
old hand

Registered: 30/04/2001
Posts: 745
Loc: In The Village or sometimes: A...
What about using the Internet Explorer control that comes with VB on your form and then pasting some HTML code into the control which has a reference to the file (on the empeg, or local hard disk or whatever).

Only problem with that is that the Windows Internet Explorer control doesn't like being resized while its got stuff in it to display.

I've used the Internet Explorer control in VB before to show a quick and dirty XML tree view - simply point the control at the XML file and you're done.


Top
#66618 - 04/02/2002 22:44 Re: Loading the RAW or PNG screen dump into VB [Re: number6]
hybrid8
carpal tunnel

Registered: 12/11/2001
Posts: 7738
Loc: Toronto, CANADA
He's already doing the IE thing. Problem is it blows for displaying images quickly and efficiently. It makes my mouse flash like some piece of crap non-interrupt-driven software cursor.

Best solution is to do your own thing with the raw image. So any code to help out in this respect will probably get Fastrack a long way. I don't have any VB code of any kind lying around. I used to have links to C sources for both parsing different formats as well as some generalized display routines.

I'd imagine that there should be some other existing support in VB for blitting a region from one area of memory to the display.

Bruno
_________________________
Bruno
Twisted Melon : Fine Mac OS Software

Top
#66619 - 04/02/2002 23:35 Re: Loading the RAW or PNG screen dump into VB [Re: hybrid8]
number6
old hand

Registered: 30/04/2001
Posts: 745
Loc: In The Village or sometimes: A...
Check out DesignerControls.com - they have a cool image library, which will work with PNG format for sure.

Oops, they've sold out to Atalasoft.com - visit their home page for information on IMGX 5.


Edited by number6 (04/02/2002 23:37)

Top
#66620 - 05/02/2002 00:03 Re: Loading the RAW or PNG screen dump into VB [Re: Fastrack]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
No. But the raw format is remarkably simple to parse. It's a non-compressed bitmap where each pixel is represented by 4 bits. Black == 0. Dark Grey == 1. Light Grey == 2. White == 3 or 15 (it's supposed to be just 3, but I've found some 15s lying around -- go figure).
_________________________
Bitt Faulk

Top
#66621 - 05/02/2002 00:12 Re: Loading the RAW or PNG screen dump into VB [Re: wfaulk]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14493
Loc: Canada
Yeah, software can use the "unused" bits as it pleases, and it's quite common to see 4-bit values for the 2-bit pixels.

Note that the .png format is about half the size, and almost as easy to parse. It has 4 pixels per byte instead of two, and there's the odd byte here and there to skip over.

-ml

Top
#66622 - 05/02/2002 00:32 Re: Loading the RAW or PNG screen dump into VB [Re: mlord]
hybrid8
carpal tunnel

Registered: 12/11/2001
Posts: 7738
Loc: Toronto, CANADA
The parsing I'm sure is the easy part. The obstacle I see for Fastrack is the display. He wants something that's going to be a lot more efficient than going through IE calls.

Bruno
_________________________
Bruno
Twisted Melon : Fine Mac OS Software

Top
#66623 - 05/02/2002 03:15 Re: Loading the RAW or PNG screen dump into VB [Re: hybrid8]
number6
old hand

Registered: 30/04/2001
Posts: 745
Loc: In The Village or sometimes: A...
Thats why the IMGX5 library is so good - it allows VB programmers to graphics stuff at C++ speed [both coding and execution].

Only problem is that its not a freebie - we have IMGX4 at work for our software and its great from VB.


The other alternative is to start fiddling with device contexts and all that stuff,

The best idea is to look at using a picturebox control in VB and 'decode' the PNG into it using PSET - won't be particularly elegant code, but I'd bet it would work better than IE.

There are also VB controls out there that can natively load PNG files into a picturebox control - from there its 'on the screen' more efficiently than with IE.

Top
#66624 - 05/02/2002 05:50 Re: Loading the RAW or PNG screen dump into VB [Re: number6]
Fastrack
member

Registered: 29/10/2001
Posts: 137
Loc: Toronto, Ontario Canada
Wow quite a few responses The image control sounds cool, but I don't want to spend money on my Empeg Control software.. hehe

I did find source to load a PNG file, and it worked fairly well but there was no way to scale the image. (And 128x32 is is not enough when running at 1280x1024).

Thanks for all the help, I guess I'll keep looking around for examples. Hehe

I've never done anything with images (Except loading a simple BMP into a picture box)
_________________________
Ben Rio Car 10GB + 60GB Toshiba ([green]Green[/green]) - Serial # 30102833

Top
#66625 - 05/02/2002 11:54 Re: Loading the RAW or PNG screen dump into VB [Re: Fastrack]
hybrid8
carpal tunnel

Registered: 12/11/2001
Posts: 7738
Loc: Toronto, CANADA
Look for seperate scaling code. Doing a 2x should be really simple stuff even without finding any examples.

Another alternative (though I don't know how well you'd get to it in VB ) is to make a small OpenGL context and throw the image on as a texture. Then you could scale to your heart's content and make use of all sorts of goodies like bilinear filtering.

Bruno
_________________________
Bruno
Twisted Melon : Fine Mac OS Software

Top