Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Help needed on display of bmp images.....

mbnrmbnr Member Posts: 3
Hello,
I am developing an application where I have two dimensional array consisting pixel values of a 256 color bitmap image. These values are calculated with in the program and need to be displayed on the screen at maximum possible speed (Similar to image processing kind of stuff and all the bmp images are of constant size 768 X 1024 pixels). There is no necessity to write them to a file or create DIB objects. Also, I need to do lot of simple matrix computations like addition and the resultant array values is what gets displayed on the screen in Runtime. I have read articles on win 32 and also using MFC classes and Open GL but unable to find any article which describes how to display runtime generated bitmap. Anybody can advise me what is the best path to choose for this application, if speed is my major concern or if I am missing to utilize a functionality that MFC or windows API provides to use with memory based bitmaps.
Thanks,
Raj

Comments

  • SephirothSephiroth Fayetteville, NC, USAMember Posts: 1,035
    Well the EASIEST way would be to use the Win32 API with LoadImage() and then blit it to the desired window. However, if you wanted to go way overboard (like I tend to do) and add all kinds of lovely mip-mapping, reflections, and the like, I would use OpenGL, then draw two triangles that fill the area you want the image displayed in, and texture-map the awesome texture to it :D!

    -[italic][b][red]S[/red][purple]e[/purple][blue]p[/blue][green]h[/green][red]i[/red][purple]r[/purple][blue]o[/blue][green]t[/green][red]h[/red][/b][/italic]

  • mbnrmbnr Member Posts: 3
    Thank you very much. I just need the simple bmp displayed as the image gets transmitted to another hardware device connected to the system and need to refresh this bmp image at the maximum possible speed I can. So I will explore it with win32. Any suggestions where to start??
    Thanks,
    Raj
  • SephirothSephiroth Fayetteville, NC, USAMember Posts: 1,035
    : Thank you very much. I just need the simple bmp displayed as the image gets transmitted to another hardware device connected to the system and need to refresh this bmp image at the maximum possible speed I can. So I will explore it with win32. Any suggestions where to start??
    : Thanks,
    : Raj
    :

    Yeah, if you're using any Windoze-based IDE, look up "LoadImage". You could also do this manually if you had to, but it would require slightly more coding. In fact, I made a small console app to convert bitmap files to the easiest format for OpenGL to understand, which is just the RGB data. The app reads in the two headers then the RGB array, and basically swaps the first and last bits (R and B), then stores just the array. I can send you the source for how I do this if you think it will help.

    -[italic][b][red]S[/red][purple]e[/purple][blue]p[/blue][green]h[/green][red]i[/red][purple]r[/purple][blue]o[/blue][green]t[/green][red]h[/red][/b][/italic]

  • mbnrmbnr Member Posts: 3
    Hello,
    Thanks for your reply. I am using VC++ and could get that module working using LoadImage. Thanks for the tip :). If possible can you mail me your application code,so that I want to check if using openGL improves any speed? My email is rajvsp@hotmail.com
    Thanks,
    Raj
  • SephirothSephiroth Fayetteville, NC, USAMember Posts: 1,035
    : Hello,
    : Thanks for your reply. I am using VC++ and could get that module working using LoadImage. Thanks for the tip :). If possible can you mail me your application code,so that I want to check if using openGL improves any speed? My email is rajvsp@hotmail.com
    : Thanks,
    : Raj
    :
    Yeah I'll see if I can't find which ZIP Disk it's on later today. I must warn you though, OpenGL is 100% hardware acceleration. This means that if you have a card (like an ATI) that is only 50% OpenGL compliant, strange things may happen, such as dark colors or worse frames than software modes (due to the other half being run through your processor). However, if you have a nice nVidia or 3dfx card, you should be happy with the results :D!

    -[italic][b][red]S[/red][purple]e[/purple][blue]p[/blue][green]h[/green][red]i[/red][purple]r[/purple][blue]o[/blue][green]t[/green][red]h[/red][/b][/italic]

  • Justin BibJustin Bib USAMember Posts: 0

    _______ || http://forcoder.org || free video tutorials and ebooks about | Ruby, C#, R, Assembly, Python, PHP, Visual Basic, Swift, JavaScript, C++, Visual Basic .NET, Java, PL/SQL, Perl, C, Delphi, Scratch, MATLAB, Go, Objective-C Scheme, Rust, Transact-SQL, LabVIEW, Kotlin, Apex, Crystal, Lua, Clojure, Erlang, Awk, Lisp, Fortran, FoxPro, SAS, VBScript, F#, Hack, Alice, COBOL, Scala, Ada, ABAP, Prolog, Bash, Dart, D, Logo, Julia, ML | _________

Sign In or Register to comment.