Results 1 to 6 of 6

Thread: blitting jpg's in DirectX 7

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2000
    Posts
    44
    OK, I've managed to blit .bmps very easily in DirectX 7.0a, using the CreateSurfaceFromRes() function. Now instead of converting the jpgs I actually wanna display into bmps I just wanna be able to blit them in a similar way. I tried passing the name of a .jpg file to the function but it says "file not found", which I think is it's way of saying to me I'm expecting too much!

    So Q1 is how do I blit jpgs using DirectX?
    Question 2 is I want to display these images over the top of the Geiss Screensaver or Winamp Plugin. As far as I know this uses DirectX to gain access to the screen, and I would imagine it's done in exclusive mode. I assume this means that I wouldn't be able to blit my stuff to the screen at the same time, or would I?

    Thanx for any help

    Matt
    VB5 Enterprise, C++Builder 5, JBuilder 3.5 (so far unused )

  2. #2
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    Q1: You can't blit JPG! You have to convert them in something like the PictureBox and then do BltFromDC (or similar)

    Q2: At first I thought that this would be totally impossible, but I think there is a way.

    You got to search the Primary surface of Geiss. If it would be in Systemmemory it would be hard, but I guess it is in VideoMem so it is nearly impossible. (nearly) I don't know how you could get the DC but it should be possible.
    But: Even if you succeed It will flicker, because you are writing to the frontbuffer! writing to the backbuffer shouldn't be a good idea, because you'd never know if it will be overwritten or not!

    Another way would be to get a real strong always on top Window. I saw something like this, but I forgot what it was (try ICQ) but I never succeed doing something like this.

    sorry for my English
    Sanity is a full time job

    Puh das war harter Stoff!

  3. #3
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    CreatesurfacefromDC is also alvalable, you load the jpg into a picturebox and create a surface from it.

    I'm sceptic about the idea of blitting to a foreign app surface just from the memory, maybe you could ask the creator if he could make the plugin extendable with activeX...
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  4. #4

    Thread Starter
    Member
    Join Date
    Feb 2000
    Posts
    44

    Thanx

    Thanx for your help on this.

    WRT your suggestion of asking the creator to extend his plugin I'm still awaiting his reply to my last email (around December last year!) regarding his plugin crashing without good cause. So I would think it extremely unlikely he's gonna respond to this one. And if he did respond I'd ask him to just do this himself...the .ini file lets you store custom messages, so it should be pretty easy to let you store paths to .bmp/.jpg/.whatever files to display on screen as well.

    I'll give your suggestions regarding the picturebox a try anyway.

    Matt
    VB5 Enterprise, C++Builder 5, JBuilder 3.5 (so far unused )

  5. #5
    Hyperactive Member
    Join Date
    Jan 2000
    Posts
    355
    or if you dont want nasty picboxes, find some manual jpeg loading code. btw i havent a clue how to do it
    buzzwords are the language of fools

  6. #6
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    Not sure if this is going to be useful, but there's some jpeg stuff here: http://vbaccelerator.com/codelib/gfx/vbjpeg.htm

    I think it lets you load your jpeg into a byte array or something.
    Harry.

    "From one thing, know ten thousand things."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width