Hi, What is the best method (if any) to set the picture of an tag using some text string representing an SVG image? That is, I don't want to change the 'src' attribute to point to another file, but to set the actual data somehow... I saw something like  which does not seem to work. Maybe I'm supposed to parse/load the file using some Javascript function? Thanks in advance! /Erik
Erik Hammar
Posts
-
Dynamically setting <img> data representing an SVG image -
Mysterious new[] and delete[] problem!Hello, and thanks for your reply! I don't think it's the delete[] operator that is the problem right now. I print the pointer that I obtain with _aligned_malloc to the screen (in my overloaded operator new[]) and then print the pointer obtained by _using_ the the new[] operator, the latter being unaligned and pointing to my actual data... so something happens between the aligned allocation in the overloaded new[] function and my assignment of the new pointer; e.g: Pointer with _aligned_malloc = 0x00a40030 (aligned on 16-byte boundary). Pointer after assigning the final object with new[] = 0x00a40034 (not aligned). Even worse, the compiler seems to add extra extra info there in debug mode - no simple workaround, such as adding and subtracting 4 bytes to the address. So I need to be able to completely handle this on my own for my program to work... hasn't anybody programmed with SSE instructions and come across this problem? :(( The delete[] operator will be a later problem, correct allocation is the most important thing right now, so that the program doesn't crasch. :) Thanks
-
Mysterious new[] and delete[] problem!Hello everybody! I have a very annoying problem here.. the thing is, I am optimizing my application with SSE `intrinsics' in some places, and the data used by such instructions must be 16-byte aligned, or the program crashes. So I have this class that contains the SSE data member, which is aligned properly WITHIN the class. I have also overloaded the `new' operator to properly handle a single object by allocating memory with void * operator new( unsigned int cb ) { void *res = _aligned_malloc( cb, 16 ); return res; } The problem comes with dynamic arrays; The compiler seems to add some _extra_ info before the actual array data, without aligning the array data properly after it. I understand that the extra information is the array length or something like that. Is there any other function I can override, that gets called _after_ operator new[] to save such information myself - aligned? Thanks anyone who helps me out.. I am having bad dreams about unaligned memory all the time. X| /Erik
-
Centered vertical alignment of menu in top frameI thought "horizontal" meant the <------------> direction..? :)
-
Centered vertical alignment of menu in top frameHello everybody! =) I have a rather irritating problem.. I'm designing a homepage with two frames. One top frame with some kind of a navigation menu in it, which I want to be centered vertically in the frame, no matter what text size is selected in IE/other browser. Can it be done with a simple selector or something in CSS, or do I have to use some dynamic coding to move it when the frame has loaded or something? :confused: Thanks for any help or suggestions! (as long it's not about removing the frames entirely ;)
-
KVM-Switch with GeForce?Hello! I actually get a screen on both computers when the BIOS loads and after that windows, but when windows has loaded, the screen turns black... but i'll try anyway... thanks!
-
KVM-Switch with GeForce?Hello, and thanks for your answer! I actually changed the resolution to 640x480, 8 bpp, 60 Hz (without the switch).... but it still didn't work. :((
-
KVM-Switch with GeForce?Hi, I have just installed a 4-port KVM switch between my two computers, one of them with linux, and the other with W2K. The one with linux has a Vodoo Banshee video card and the windows computer has GeForce 2. When the windows computer has loaded W2K, and is about to boot the drivers for GeForce (when the mouse cursor should be showing), the screen turns black! The linux computer works perfectly. Both cards are AGP. Has anybody experienced this or a similar problem with KVM switches? :confused: Thanks! Erik
-
Multi-monitor problemYes it has, and I have to set it to PCI, for Windows to find the other card. =/
-
Multi-monitor problemHi! Ok, so is it even possible to have the BIOS boot up with AGP and use the PCI card in Windows as a secondary monitor? Thanks for the answer! Erik Hammar
-
Multi-monitor problemHeh! Don't we all just love new "features"! If it actually IS "by design", then I wonder if they will ever realize that it is pretty obvious that people would rather play their games on a bigger and better monitor (on a better graphics card). I have to get a T-shirt with "I love features" written on it. :-D
-
Multi-monitor problemI read the article, and it said "If you have multiple monitors connected to your computer and you run an MS- DOS-based program, it may be run only on the primary monitor. " But what do they mean by "the primary monitor"? The one that is set to "primary" in display settings or the one that the BIOS loads on? My PCI card is primary in BIOS, because otherwise Windows doesn't even find the other one! "STATUS This behavior is by design. " <--- Bad design? X|
-
Multi-monitor problemHi Thanks for your answer! Even though it didn't help solve the mystery, it verified what I feared. I find it really strange, though, that it shouldn't be possible, since i can run DOS games with an AGP card, without the second monitor.
-
Multi-monitor problemHi everybody! I am running Windows 2000 with two monitors (one on a PCI card and the other on the AGP card). Everything works fine, except that every time I start a DOS program, it is shown on the old monitor on the PCI card... My AGP monitor is set to "Primary" in display settings in Windows. Is there any way to solve the problem? Thanks in advance! :) Erik Hammar
-
Developing PS1 games with Visual C++?Hi! Is it possible to download some kind of processor plugin and standard libraries for Visual C++ to develop PlayStation (1) games with? Thanks, Erik :)
-
Vector in a bitmapHi, I am making a game where the level is represented by a bitmap. When something (a bullet, for example) hits a non-transparent pixel I want it to bounce off some kind of normal vector that i need to find. If anybody has an idea on how to do this, I would be very grateful! :) Thanks! Erik
-
'new' limitStrange... moving the class3 creation code to the top, seems to eliminate the problem. That's strange, because the class3 doesn't even touch the class1 and class2 Anyway, Thanks for your concern!
-
'new' limitI get it after 5 times... ... byte *bmpdata = new byte[256*240]; memsize 1 > 128KB class1 = new CClass1(memsize1) (inside CClass1's constructor) data = new byte[memsize1] memsize 2 > 128KB class2 = new CClass2(memsize2) (inside CClass2's constructor) data = new byte[memsize2] class3 = new CClass3 - this is where it crashes (before the actual constructor of CClass3) ... Seems really strange to me, that this hangs the program, and not only gives me a NULL pointer!
-
'new' limitNo it's not a loop... I create instances of about 5 classes, which each allocate one or two blocks of memory...
-
'new' limitHi, all you happy coders I Hope somebody can help me with this problem I am having: In my program i try to allocate about 500KB (in smaller pieces) with the new operator, but it hangs in some function called '__sbh_alloc_block'... Is this because I can't get more memory from windows...? Thanks in advance, Erik Hammar :confused: