Author Topic: Placing JPEG image at the Background of card.  (Read 3598 times)

Jeff

  • Newbie
  • *
  • Posts: 33
Placing JPEG image at the Background of card.
« on: June 30, 2011, 11:40:21 PM »
While viewing the BooksHN project, I noticed something interesting, the background looks like wood.

I opened it using the HN creator checked the codes but could not figure it out.

How do you put the wood1.jpeg file at the background?

Thank You.
« Last Edit: January 01, 1970, 01:00:00 AM by Guest »

Malkom

  • Administrator
  • Newbie
  • *****
  • Posts: 461
  • Here to help you
Re: Placing JPEG image at the Background of card.
« Reply #1 on: July 01, 2011, 06:11:01 AM »
There are a few commands for displaying an image on a card background - CardLoadImage, CardLoadImageAbs, CardLoadImageXP and CardLoadImageXPAbs - local file, absolute file path and crossplatform local and crossplatform absolute respectively.

If you are using a lot of cards each having the same background image then the CardBankImage command is useful as only one image is held in memory.

This is the code from the BooksHC project - it uses the CardBankImage command.

Code: [Select]
Local okay,numcards,n

@ Reserve space for 1 image bank
ImageBankReset
ImageBankReserve(1)

@ Check if enough memory to load image
Put ImageBankSetSizeFN(1,640,480) into okay
If okay=1 Then
    @ Load image into bank
    ImageBankLoad(1,'wood1.jpg',1)
    @ --- Home Card ---
    CardBankImage(1,1)
    @ --- Template Card 2 ---
    CardBankImage(2,1)
    @ --- For Player with more data cards ---
    Put TotalCardsFN into numcards
    If numcards>2 Then
        For n=1 To numcards
            CardBankImage(n,1)
        EndFor
    EndIf
EndIf
« Last Edit: January 01, 1970, 01:00:00 AM by Guest »
I am sorry but I do not have time to answer questions by PM or email.
If you post your questions in this forum then it might help others.

 

anything