Results 1 to 6 of 6

Thread: Saving a TBitmap to a VTDB

  1. #1

    Saving a TBitmap to a VTDB

    Hi All!

    Does anybody have any ideas to save a Bitmap to a VTDB?
    I want to do this without using a TAGFImage (because then I'll need an IDirectDevice).

    Actually I'm looking for a piece of code like the VTDBTool in which the bitmaps are saved to the VTDB!

    Thanx in advance,

    Coen
    Check our RPG-project 'Cataclysm', download the beta v0.11 of the game engine and let us know what you think on our forum!
    <br />http://cataclysm.servegame.com

  2. #2

    Saving a TBitmap to a VTDB

    In examples section (for PD3 - it's in "PowerDraw2.x Examples" directory) there is VTDView sample. It only loads bitmaps, so you'll have to figure out how to do it vise-versa (sorry, right now got no time to provide an example)...

    - Lifepower

  3. #3

    Code to transfer TBitmap to TAGFImage

    Here it is:

    procedure BitmapToAGF;
    var
    LRect: TD3DLocked_Rect;
    Res, i: Integer;
    DestP: Pointer;
    begin
    b.PixelFormat := pf32bit; // convert bitmap format to 32-bit

    a.Finalize;
    Res := a.Initialize(TexWidth, TexHeight, PtCount, PtWidth, PtHeight, D3DFMT_A4R4G4B4);
    if (Res <> errNone) then Exit;

    Res := a.Lock(0, LRect);
    if (Res <> errNone) then Exit;

    for i := 0 to a.TextureHeight - 1 do
    begin
    DestP := Pointer(Integer(LRect.Bits) + (LRect.Pitch * i));
    try
    pdrawLineConv(b.Scanline[i], DestP, a.TextureWidth, D3DFMT_A8R8G8B8, D3DFMT_A4R4G4B4);
    except
    end;
    end;

    Res := a.Unlock(0);
    if (Res <> errNone) then Exit;

    a.TransparentColor := Color;
    end;

  4. #4

    Powerdraw 2.42

    I tried that, and it looks alright. I think it will work in Powerdraw 3, but the PDrawEx.Dll in PowerDraw 2.42 doesn't seem to have pdrawLineConv... Any suggestions how to get the code working in Powerdraw 2.42?

    Thanx in advance!

    Coen
    Check our RPG-project 'Cataclysm', download the beta v0.11 of the game engine and let us know what you think on our forum!
    <br />http://cataclysm.servegame.com

  5. #5

    Saving a TBitmap to a VTDB

    It does only work in v3 I think. I never used any previous versions of PowerDraw.

    Regards,
    Kornalius

  6. #6

    Version 3

    Ok! That's what I thought... no problem, we'll just have to wait doing that until version 3 goes final

    Thanx for your help!

    Coen
    Check our RPG-project 'Cataclysm', download the beta v0.11 of the game engine and let us know what you think on our forum!
    <br />http://cataclysm.servegame.com

Bookmarks

Posting Permissions

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