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.

Dark GDK / DGK, C++: Vista; Does not have permision to copy bitmap

Author
Message
Timidon
19
Years of Service
User Offline
Joined: 26th Jun 2005
Location: Bakersfield, Ca. USA.
Posted: 10th Oct 2010 09:00 Edited at: 10th Oct 2010 18:34
Ran into a issue with 2 vista machines, one with Ultimate and the other Home Edition, when I was working on a testing out my program. On both systems Vista a error pops up when the program runs and said that "Tried to read a surface which has no read permissions!". Tried to run the program in Administration mode, coming up with the same results. Next also tried to run the program in XP compatible modes, both came up with the same error. Just checking if anybody else running a Vista system have ran into a similar problem and how they solved it. Both systems where laptops, one very nice with good 3d card built in the other not so nice, has a bear bones 3d card.

There are many answers but just one question" ~ Jerilith the Mad
Timidon
19
Years of Service
User Offline
Joined: 26th Jun 2005
Location: Bakersfield, Ca. USA.
Posted: 11th Oct 2010 04:51
I can make a work around that is slower and does not give me the read error. So I thought about how to do this, the problem so far rears its ugly head on my Vista related systems, had not had a chance to work with a Windows 7 yet, but good chance it will show up there as well. So I was trying to figure out what function to call to figure out what OS I was running and got this response:

From IamM:
Quote: "That's not a smart way to deal with the problem - there's nothing specific about Vista that disables the reading of a surface, so your 'fix' would work right up until you encounter exactly the same problem with an XP or Windows 7 system.

See if you have anti-aliasing enabled in the drivers, and double-check that you are creating the surface correctly in the first place.
"


Big Question now. Is how do you create the surface correctly? I moved the quote from the original thread to here. Since the questions are similar in nature.

I am using this method:



nScreenXSize & Y are the screen size of the computer running the program.

Is there another way of formatting this that I should be aware of?

There are many answers but just one question" ~ Jerilith the Mad
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 11th Oct 2010 05:58
Just out of curiosity, what is the workaround?
Timidon
19
Years of Service
User Offline
Joined: 26th Jun 2005
Location: Bakersfield, Ca. USA.
Posted: 11th Oct 2010 06:27 Edited at: 11th Oct 2010 06:31
The Short: I am not going to try and grab the screen images that make up the boarder. Going back to the dbPasteImage().

The Long: I am working on testing the work around. The issue I have is when I try to "read" from the surface of a off page bit map. I have no problem with images that are "loaded" in, such as dbLoadImage(); I can paste them, no problem to the main screen, assign the images to sprites. I figure the problem comes in when I created a image, I was working on scaling the boarders so I drew out the boarders, and went to create a new image of that section. That's when I get the error. "System Memory Error: Tried to read a surface which has no read permissions!" on my Vista machine. I will be giving this a test in just a bit. Takes some time to retool a bit code to practice this idea. So I am going back to just stamping the screen bits, without the making full sized images. As I said it's a work around and it is slower.

To be honest, its the first time I have ran across this error, and the first time I started manipulating Bitmaps. Back to coding..

There are many answers but just one question" ~ Jerilith the Mad
Timidon
19
Years of Service
User Offline
Joined: 26th Jun 2005
Location: Bakersfield, Ca. USA.
Posted: 11th Oct 2010 06:49 Edited at: 11th Oct 2010 07:33
Running a few more test pass's. I am convinced that the issue is the "dbGetImage()" function triggering the error on my Vista System. It's happening at the points when I call the program to grab a screen image. Granted my laptop is not the best platform to test this out on, but it is telling me what is going on. Now Why? it does this is unknown. . . .as of yet.

Also could be a 32bit vs a 64bit operating system issue to, just thought of that. The program is written on windows XP home, which is a 32bit os. My Vista (and my friends os) are the 64bit version. That could be the issue as well.

Well I am done with this thread for now. Unless there is another work around. At present I can't grab screen images in Windows Vista, But I got it running again on my Laptop - so back to work.

There are many answers but just one question" ~ Jerilith the Mad
Timidon
19
Years of Service
User Offline
Joined: 26th Jun 2005
Location: Bakersfield, Ca. USA.
Posted: 11th Oct 2010 06:50
So how fast is sprite stamping verse pasting the image?

There are many answers but just one question" ~ Jerilith the Mad
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 11th Oct 2010 15:23
I didn't see that you had double posted this question, and as your question was in the general programming forum, I couldn't make any guesses as to how you had created your surface.

Rather than using dbGetImage(), you could render directly to an image instead (dbSetCameraToImage), then render that camera only to build the image.

Utility plug-ins (26-JUL-2010)
I'm applying terms of use that require you to wear a red nose and honk a horn whenever you use the Internet
Timidon
19
Years of Service
User Offline
Joined: 26th Jun 2005
Location: Bakersfield, Ca. USA.
Posted: 11th Oct 2010 16:14 Edited at: 11th Oct 2010 17:28
Quote: "I didn't see that you had double posted this question, and as your question was in the general programming forum, I couldn't make any guesses as to how you had created your surface."


One was about the figure out what OS I was playing on, to build the work around for other (this one was what about the specific problem I am having. Two questions where separate but related. I just moved your answer into here. Needless to say I have worked around the problem by not using the dbGetImage() command on my Visa machine. Though I will have to test out the standard BitMap functions, just thinking about this morning.

Since I figure getting the OS was not really related to DGK, I think it was the right place to do so. But you did give some advice. Thanks.

There are many answers but just one question" ~ Jerilith the Mad
Mireben
15
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 11th Oct 2010 23:05
Did you use dbLockPixels by any chance? Just a wild guess, I remember seeing on the forum that "get image" does not work on a locked surface. Also, is the same DirectX version installed on the Vista machine?
Timidon
19
Years of Service
User Offline
Joined: 26th Jun 2005
Location: Bakersfield, Ca. USA.
Posted: 12th Oct 2010 03:29
Quote: "Did you use dbLockPixels by any chance? Just a wild guess, I remember seeing on the forum that "get image" does not work on a locked surface. Also, is the same DirectX version installed on the Vista machine? "


I have heard of that command, but I did not use it. What would be the reason for Locking the Pixels? What's the advantage/disadvantage?

I would say that the Direct X version on my Vista Machine and my XP should be same, as I use the machines often. I can't say much about my other friends machine though other than it was a Vista OS as well.

I wonder if dbGetImage locks the pixels before it copies?

Well off to coding, thanks for the Idea.

There are many answers but just one question" ~ Jerilith the Mad

Login to post a reply

Server time is: 2024-06-30 11:43:26
Your offset time is: 2024-06-30 11:43:26