Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, VoroneTZ), 1,258 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
question about bitmap #413820
12/18/12 17:58
12/18/12 17:58
Joined: Jul 2011
Posts: 69
P
pjotr987 Offline OP
Junior Member
pjotr987  Offline OP
Junior Member
P

Joined: Jul 2011
Posts: 69
hi there,
my todays question is related with bitmaps. i wrote a small console, that sends files from one end to another. now i want to send a jpg picture from a to b, what works fine. as result i get in liteC an array with bit information in it. HOW can i display this jpg image on screen without saving and reloading it again?
it takes too long to save and to reload it. can something be done directly with the received array, to show it directly?

thanks for anny idea in advance

Last edited by pjotr987; 12/18/12 17:59.
Re: question about bitmap [Re: pjotr987] #413823
12/18/12 18:40
12/18/12 18:40
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
txesmi Offline
Serious User
txesmi  Offline
Serious User

Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
Never tryed something related but what about...
(LPDIRECT3DTEXTURE9*)bmap.d3dtex?

Re: question about bitmap [Re: txesmi] #413825
12/18/12 19:56
12/18/12 19:56
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
Have you tried adding the content to the egines buffer with add_buffer?

http://www.conitec.net/beta/aadd_buffer.htm


Always learn from history, to be sure you make the same mistakes again...
Re: question about bitmap [Re: Uhrwerk] #413828
12/18/12 20:20
12/18/12 20:20
Joined: Jul 2011
Posts: 69
P
pjotr987 Offline OP
Junior Member
pjotr987  Offline OP
Junior Member
P

Joined: Jul 2011
Posts: 69
hi its me again,
i cant follow the the suggestion from txesmi. but Uhrwerk can u please specify how i can utilize the add_buffer function for my needs?
i have an array "int[6400]" there is the entire jpg file in binaroc form. now i want to turn it so, that i can display it as pannel without saving it first.

thanks

Re: question about bitmap [Re: pjotr987] #413835
12/18/12 21:22
12/18/12 21:22
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
Code:
// Obtain the image data
byte* yourImageBytes = obtainYourImageBytesOverNetwork();
// Add the image data to the engine's buffer.
add_buffer("mybitmap.jpg",yourImageBytes,countOfYourImageBytes);
// Now you can load from this buffer
BMAP* bmapToDisplay = bmap_create("mybitmap.jpg");
// Don't forget to release the buffer
add_buffer("mybitmap.jpg",NULL,countOfYourImageBytes);


I haven't tested or compiled the above code. It's just meant to give you the basic idea.


Always learn from history, to be sure you make the same mistakes again...
Re: question about bitmap [Re: Uhrwerk] #413983
12/20/12 19:34
12/20/12 19:34
Joined: Jul 2011
Posts: 69
P
pjotr987 Offline OP
Junior Member
pjotr987  Offline OP
Junior Member
P

Joined: Jul 2011
Posts: 69
hi its me again,
Uhrwerks code seems to make sense, except that the compiler comlains that there is an invalid pointer. here the modified code. i tried to save the buffer in a file to look whats exactly in it. but didnt worked out so far.
here the code:

byte* yourImageBytes = server_push;
//Add the image data to the engine's buffer.
add_buffer("mybitmap.bmp",yourImageBytes,6400);
//Now you can load from this buffer
BMAP* bmapToDisplay = bmap_create("mybitmap.bmp");
//Don't forget to release the buffer
add_buffer("mybitmap.bmp",NULL,6400);

var file7 = file_open_read("mybitmap.bmp");
var file8 = file_open_write("i:/in/bild0-buffer.txt");
var file_size7;
file_size7=file_length(file7);
int counter33;
int buff;
while (counter33 < file_size)
{

buff=file_asc_read(file7);
file_asc_write(file8,buff);
counter33++;
wait(1);
}


Last edited by pjotr987; 12/20/12 19:35.
Re: question about bitmap [Re: pjotr987] #413988
12/20/12 21:01
12/20/12 21:01
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
I guess server_push is a function isn't it? Otherwise you could have diretly used server_push instead of yourImageBytes. In this case you forgot the parantheses behind it and hence the code will crash as yourImageBytes points to a function.

Please use code tags when posting code.


Always learn from history, to be sure you make the same mistakes again...

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1