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 / WTH? what's going on here? Runtime Error 500\odd memblock image

Author
Message
Neuro Fuzzy
19
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 15th Jan 2011 01:23
I have this code... it uses my fractal code that I just posted in code snippets. I made a modification to it so that it draws to a memblock, makes an image from the memblock, and then saves the image and pastes it on the screen. However, I get this error:

Runtime Error 500 - Unknown image error at line 137

Apparently this is caused by a loose pointer? (aaron miller's second to last post)

The code surrounding the "save image" command is here:


If I comment out "save image", then I do get an image showing from paste image, but it's nothing like it should be!

This definitely reminds me of a memory leak, especially because there are random patterns. In fact, the only "color" I pass in is rgb(200,200,200) and 000000. There shouldn't be anything but grey and black!

So... can anyone tell me - What is going on?!?! The code i'm using to draw the memblock images is the same code I've used here, and the original, working, fractal code is here.

I honestly have no idea what's going on, and I don't think I have errors in my memblock image handling or image creation...





this is the whole code. I don't believe it uses any plugins.


Neuro Fuzzy
19
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 15th Jan 2011 01:33
X_X

nevermind... I figured it out...
#1: you can't include the directory in the images name
#2: creating an image from a memblock, when the image already exists, messes things up, so you get something like what's visible in my first post.

Originally I deleted it and then recreated the image, but in an attempt to fix bug #1, I created bug #2.


Please, forget this X_X

BatVink
Moderator
23
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 15th Jan 2011 09:02
No need to forget this, it will be useful to other people down the line. Thanks for letting us know what caused it.

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 15th Jan 2011 18:09
Quote: "#1: you can't include the directory in the images name"


That's a strange limitation. Other save commands don't have that restriction. I'll test this myself tomorrow and post a bug report if necessary.
TerryRussell
15
Years of Service
User Offline
Joined: 11th Dec 2010
Location: Chichester, UK
Posted: 2nd Mar 2011 20:41
Excuse me for posting this so long after you asked the question, but I came across this whilst looking for something completely different.

You CAN include directory filepaths in your command. But don't use single backslashes. You can use double backslashes, but my preferred method is to use forward slashes. No problems that way.

So "C:\Somedirectory\myimage.jpg" won't work.
But "C:\\Somedirectory\\myimage.jpg" does.
And "C:/Somedirectory/myimage.jpg" looks much better (I think) and works perfectly well.

The reason (if you are interested) is that if you use a backslash, the system thinks that the next character has a special meaning. Examples:

\T means "tab character"
\R means "character 10 (carriage return at the end of a line of text in some contexts)
\N means "Character 13" (new line at the end of a line of text in some contexts)

and so on.

Backslash=bad, forward slash=good.

Amazing Simulation
www.amazing-forum.com

Login to post a reply

Server time is: 2026-07-16 01:44:33
Your offset time is: 2026-07-16 01:44:33