Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
N

Naturality

@Naturality
About
Posts
32
Topics
5
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Am I the only one who intentionally avoids buying games?
    N Naturality

    I managed to stave off buying New Vegas, but unfortunately I received as a Christmas gift. My time is now GONE.

    "Sir, I protest. I am NOT a merry man!"

    The Lounge com game-dev sales help question

  • Which Antivirus?
    N Naturality

    Same here. Better protection than AVG and not nearly as invasive as most security programs. :)

    "Sir, I protest. I am NOT a merry man!"

    The Lounge question discussion announcement

  • How well does your browser support HTML5?
    N Naturality

    Chrome 6.0.427.0 dev = 217 (+ 10 Bonus Points)

    "Sir, I protest. I am NOT a merry man!"

    The Lounge html com question

  • Benefits of being a MCPD [modified]
    N Naturality

    if(Ω < 1) *resistance = futile;

    "Sir, I protest. I am NOT a merry man!"

    The Lounge help question career learning

  • good programmer
    N Naturality

    "Excellent programmers are out of the job because they try to market their theoretic potential (venture) rather than hard facts (results)" Huh, so all excellent programmers are physicists at heart?

    "Sir, I protest. I am NOT a merry man!"

    The Lounge question

  • Help Accessing Functions in a Dll
    N Naturality

    Thank you very much! I feel like a total fool now, though. Classes in C?! They should revoke my C++ licence for that. :laugh:

    "Sir, I protest. I am NOT a merry man!"

    C / C++ / MFC help c++ php com performance

  • Help Accessing Functions in a Dll
    N Naturality

    Hi, I recently started my first project based around DLLs and have run into a little trouble. I followed this tutorial: http://www.codeguru.com/cpp/cpp/cpp\_mfc/tutorials/article.php/c9855 The code is split up into a header file and a source file. It consists of a namespace, which contains variables and a class. I am linking implicitly. In a test program I can access the variables fine, no problems there, but when I use a function from the class, I get linker errors, eg:

    1>ELQTest.obj : error LNK2019: unresolved external symbol "public: static bool __cdecl ELQ::Functions::CreateRot(void)" (?CreateRot@Functions@ELQ@@SA_NXZ) referenced in function _SDL_main

    = sin((x-360)*0.017); } } } #include "stdafx.h" #include "ELQDLL.h" #include SDL_Surface *screen; int main(int argc, char *argv[]){ if(ELQ::Functions::CreateRot()) system("PAUSE"); return 0; } Any idea what could be wrong? I've played around with all sorts of combinations of class definitions, export/import symbols etc, yet cannot get this to work. Look forward to your input, Thanks, Nat. PS: Oh, I should say that when I compile the DLL, I get a stream of inconsistency messages, could this be related? "Sir, I protest. I am NOT a merry man!"

    C / C++ / MFC help c++ php com performance

  • What would YOU put in the LHC?
    N Naturality

    I hear they're already planning the VLHC(Very Large Hadron Collider) for 50 years time, so that would be the RVBLHC(Really Very Big Large Hadron Collider) :o If it were up to me, I'd smash pigeons. ...or maybe 2 Higgs Bosons!

    "Sir, I protest. I am NOT a merry man!"

    The Lounge performance question

  • SetPixel() too slow?
    N Naturality

    Thanks, I've been looking into it and it seems like it's the answer for me :-D

    "Sir, I protest. I am NOT a merry man!"

    Graphics data-structures question

  • SetPixel() too slow?
    N Naturality

    Hi, thanks for your reply. Is there a way to set the pixels of a DDB with this? I had thought it was DIB only?

    "Sir, I protest. I am NOT a merry man!"

    Graphics data-structures question

  • SetPixel() too slow?
    N Naturality

    Hi, I wasn't sure where to put this, but this seems the most appropriate place. I'm trying to load an image from a 2 Dimensional array into the main screen DC, like so.

    for(int y = 0; y < height; y++){
    for(int x = 0; x < width; x++){
    SetPixel(imgDC, x, y, RGB(imgarray[x][y], imgarray[x][y], imgarray[x][y]));
    }
    }

    StretchBlt(hdc, 0,0, 640, 480, imgDC, 0, 0, width, height, SRCCOPY);

    But this becomes too slow for my needs if the image if larger than about 256x256. I have also tried using do while loops, which were a fraction faster. Is there a better way to do this?

    "Sir, I protest. I am NOT a merry man!"

    Graphics data-structures question

  • Bitmap blur problem [modified]
    N Naturality

    Unfortunately I haven't got it to work yet. I shall keep at it, however.

    "Sir, I protest. I am NOT a merry man!"

    Graphics help graphics data-structures

  • Ugly or a horror?
    N Naturality

    Fast enough that changing it would have no observable change. ;P But then, that may just be the fruits of overclocking.

    "Sir, I protest. I am NOT a merry man!"

    The Weird and The Wonderful question

  • Bitmap blur problem [modified]
    N Naturality

    Hmm.... I tried recreating the file using the other program(which uses the same values in bmp and bfh) using the CREATE_NEW definition in the CreateFile() function. When I do this, the resulting image cannot be drawn by windows picture and fax viewer. This may be the problem...

    "Sir, I protest. I am NOT a merry man!"

    Graphics help graphics data-structures

  • Bitmap blur problem [modified]
    N Naturality

    Okay, fixed that. Still get the same output, though.

    "Sir, I protest. I am NOT a merry man!"

    Graphics help graphics data-structures

  • Bitmap blur problem [modified]
    N Naturality

    Hmm.... xp is set to 4294967295 and does not change with each loop... y, however, does as is wanted.

    "Sir, I protest. I am NOT a merry man!"

    Graphics help graphics data-structures

  • Bitmap blur problem [modified]
    N Naturality

    I spotted the initialisation of xp and yp straight after posting. But it had no effect. :( I wasn't aware you could check if it was an RGBTRIPLE. Ignorance, I guess. How would I go about this? However, the other program I am using to create the random noise input image seems to work fine with the same values in the header BITMAPINFOHEADER and BITMAPFILEHEADERs. Oh, and, rather ironically, I used so many function calls to try and clean the for loops up. :^)

    "Sir, I protest. I am NOT a merry man!"

    Graphics help graphics data-structures

  • Bitmap blur problem [modified]
    N Naturality

    Thanks for the advice :D. But now, the output is just red and black lines :doh: Here's the updated code:

    unsigned int yp=0, xp=0;

    for(int y = 1; y < bmp.biHeight-1; y++){
    for(int x = 1; x < bmp.biWidth-1; x++){
    for(int i = 0; i < 9; i++){
    {
    get_pixel(x+xp,y+yp,blank[i],image);
    if(xp<2)
    xp++;
    else{
    xp = -1;
    yp++;}
    }
    }
    avg(blank, Merge, 9, Matrix);
    set_pixel(x,y,Merge,image2);
    clear_pixel(Merge);
    yp=-1, xp=-1;

    }}
    

    "Sir, I protest. I am NOT a merry man!"

    Graphics help graphics data-structures

  • Bitmap blur problem [modified]
    N Naturality

    Yes, I did. However, I don't see how my pixel lookup is wrong. :S

    "Sir, I protest. I am NOT a merry man!"

    Graphics help graphics data-structures

  • Bitmap blur problem [modified]
    N Naturality

    Well, this those changes, it now comes out red and black instead of grey and black. I'm Sure I'm doing it wrong too. :sigh:

    "Sir, I protest. I am NOT a merry man!"

    Graphics help graphics data-structures
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups