Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Make Memblock From Bitmap not working with 1920x1080 (or larger) images

Author
Message
SamJ
14
Years of Service
User Offline
Joined: 27th Dec 2011
Location:
Posted: 9th May 2012 02:26
I have found that if I load in a bitmap that is much larger than 1280x720, such as 1920x1080, the Make Memblock From Bitmap command does not properly store the bitmap data. It stores the proper width, height and depth but all color data returns 0, even if the image is solid white. Can anyone shed light on why this is (I have one of the newest GTX video cards with 2GB of memory, on Windows 7).

Here's a simple code snippet. The images used are just solid white, one is 1920x1080 and one is 1280x720. The smaller one works fine, the larger one is unable to read any proper color data.



I haven't tested thoroughly but I think loading the large bitmap as an image, then pasting it to a bitmap and using that bitmap for memblock creation works as expected even with the larger image.
gwheycs62egydws
16
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 9th May 2012 09:06
@SamJ

hi

that's a large image to load and bmp are large to begin with
compared to jpg or tga images file

umm why do you have a need to load such large image files ?

to move side ways - is to move forward
Since a Strait line gets thin fast
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 9th May 2012 09:48
looking to see the solution here as I may BuMP into this soon myself...



gwheycs62egydws
16
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 9th May 2012 10:21
I would think a size of 1027 x 768 would be good enough for any screen size ?

to move side ways - is to move forward
Since a Strait line gets thin fast
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 9th May 2012 11:08
you mean 1024 right?

gwheycs62egydws
16
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 9th May 2012 11:11
umm yes thats the number lol

just a typo

even it was set for 1027 it should be ok
not that any one uses that size

to move side ways - is to move forward
Since a Strait line gets thin fast
Scraggle
Moderator
23
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 9th May 2012 12:40
It works perfectly for me.
I would presume it is a memory issue. 1920 x 1080 x 4 bytes is a hell of a lot of memory to set aside.

Ask yourself this:
Do you need the screen to be as large as the bitmap?
Do you need the bitmap to stay in memory after you have used it?

If the answer is no to both then try this to see if it works:
darkvee
20
Years of Service
User Offline
Joined: 18th Nov 2005
Location:
Posted: 9th May 2012 19:26 Edited at: 9th May 2012 19:27
You can load that bitmap with any pc even if the video card only lets you say be able to run 512,512. I streamed a image that was 102400x102400 with a low-end pc in without a problem. When you run into this issue, I would stream the bitmap in. Streamming the bitmap in always works for this issue. It's pretty easy to do too. Just use your memblock and code it were it streams it in.

darkvee
gwheycs62egydws
16
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 9th May 2012 19:55
umm why not use a jpg or like type

bmp's are take a lot of hard drive space .. mind you I've seen jpg
images ware the pixels blend too much and messes the look of the image

to move side ways - is to move forward
Since a Strait line gets thin fast
Mage
Valued Member
19
Years of Service
User Offline
Joined: 3rd Feb 2007
Location:
Posted: 10th May 2012 11:58
Quote: "umm why not use a jpg or like type

bmp's are take a lot of hard drive space .. mind you I've seen jpg
images ware the pixels blend too much and messes the look of the image"


Both image formats take the same amount of memory when loaded.

Login to post a reply

Server time is: 2026-07-10 15:15:31
Your offset time is: 2026-07-10 15:15:31