Search:

Type: Posts; User: lamko

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    24
    Views
    2,581

    Your right anduril462 was the ncols of 8 totally...

    Your right anduril462 was the ncols of 8 totally forgotten. CommonTater I didn't used the computer to calculate it, I just viewed the memory adresses of my computer to see if the compiler was doing...
  2. Replies
    24
    Views
    2,581

    With this code : rptr[k] = aptr + (k * ncols);...

    With this code : rptr[k] = aptr + (k * ncols); I'll get these values :
    rptr adres = 0x602090 the value there stored is aptr[0] adres = 0x602010
    the other pointers are aptr[1]0x602028,...
  3. Replies
    24
    Views
    2,581

    Thx for the info quzah, the padding problem for...

    Thx for the info quzah, the padding problem for writing to file I used : __attribute__((__packed__))

    edit :

    Jup, foo[1][2]
  4. Replies
    24
    Views
    2,581

    Fine, that I'll understand, but now I want to...

    Fine, that I'll understand, but now I want to find the specific struc[1][2] in memory. Any tips on that ?
  5. Replies
    24
    Views
    2,581

    I'll get It know why I don't have to use...

    I'll get It know why I don't have to use sizeof(BYTE) *image[0] is giving me the size of the struct.
    But what is this line doing : rptr[k] = aptr + k*ncols; I thought it wat creating positions to...
  6. Replies
    24
    Views
    2,581

    I know that but I want to verify it's really...

    I know that but I want to verify it's really working!
    rptr[k] = aptr + (k * sizeof(BYTE) * 3 * ncols);
    Where is the space it's using to save the struct ? Or how do I debug this to find it ?
  7. Replies
    24
    Views
    2,581

    I wanted another try but now array's contents to...

    I wanted another try but now array's contents to be contiguous in memory. I'm surelly gone follow all your advice but this is pure me messing around with pointers.
  8. Replies
    24
    Views
    2,581

    It's a two dimensional array Where do you guys...

    It's a two dimensional array Where do you guys think the structure gets saved in memory after seen te ptr values ?
  9. Replies
    24
    Views
    2,581

    Here's my code : #include ...

    Here's my code :



    #include <stdio.h>
    #include <stdlib.h>
    #include <stdint.h>

    typedef uint8_t BYTE;
    typedef uint32_t DWORD;
  10. Replies
    24
    Views
    2,581

    But why the 3 ? Who can explain to me that ! I...

    But why the 3 ? Who can explain to me that ! I need to allign in memory to write it back to file.
  11. Replies
    24
    Views
    2,581

    Ptr + byte gives offset + 3 ?

    I want to create a distance of 1 byte between the pointers. So I don't get this debugging session where I'll get a distance of 3. Here's a image :

    http://i54.tinypic.com/2j0zby0.png

    Hopefully...
  12. Thread: resize image

    by lamko
    Replies
    22
    Views
    7,436

    Finally a working version after also reading this...

    Finally a working version after also reading this : Pointers Usage in C++: Beginners to Advanced - CodeProject



    #include <stdio.h>
    #include <stdlib.h>
    #include <stdint.h>

    typedef uint8_t ...
  13. Thread: resize image

    by lamko
    Replies
    22
    Views
    7,436

    I've thought I was stuck but i've found this...

    I've thought I was stuck but i've found this website : A Tutorial on Pointers and Arrays in C and it is explaining just the things I need to grasp all this stuff. Now of to master it :)
  14. Thread: resize image

    by lamko
    Replies
    22
    Views
    7,436

    I've changed your code a bit to my vars ...

    I've changed your code a bit to my vars


    RGBTRIPLE **image = malloc(biHeight * sizeof(*image));
    for (i = 0; i < biHeight; i++)
    image[0] = malloc(bi.biWidth * sizeof(*image[0]));...
  15. Thread: resize image

    by lamko
    Replies
    22
    Views
    7,436

    So int * is the pointer array, So it's using a...

    So int * is the pointer array, So it's using a array that is created by them self. That also explains the int **array.
  16. Thread: resize image

    by lamko
    Replies
    22
    Views
    7,436

    so the first call is there to make room for an...

    so the first call is there to make room for an array of pointers
    But it is here a int right ! So you could leave the *
  17. Thread: resize image

    by lamko
    Replies
    22
    Views
    7,436

    copy paste from the 1st example Question 6.16...

    copy paste from the 1st example Question 6.16 I thought about what you suggested it makes that clear to me now. Didn't know you could use structures like that.
  18. Thread: resize image

    by lamko
    Replies
    22
    Views
    7,436

    That I'm also doing : 24 bit and my struct is...

    That I'm also doing : 24 bit and my struct is RGBTRIPLE

    But I need to learn some stuff on pointers to pointers for me to get whats going on here :
    int **array <- how to change this ?
    (RGBTRIPLE...
  19. Thread: resize image

    by lamko
    Replies
    22
    Views
    7,436

    You mean something like this : int **array =...

    You mean something like this :


    int **array = malloc(biHeight * sizeof(RGBTRIPLE *)); <- why do you need here a RGBTRIPLE * ?
    array[0] = malloc(biHeight * bi.biWidth * sizeof(RGBTRIPLE)); <-...
  20. Thread: resize image

    by lamko
    Replies
    22
    Views
    7,436

    Thx, I think I just got overwhelmed with all the...

    Thx, I think I just got overwhelmed with all the stuff, didn't understand al the pointer stuff and syntax of fread.
  21. Thread: resize image

    by lamko
    Replies
    22
    Views
    7,436

    Bmp format is no problem, i'm at step 4. But now...

    Bmp format is no problem, i'm at step 4. But now to understand all the stuff.
  22. Thread: resize image

    by lamko
    Replies
    22
    Views
    7,436

    resize image

    I need some guidance on how to resize a bmp image at run time. I thought I should use a 2 dimensional dynamic array.
    What steps do I need to take to do something like this. fread and fwrite are...
  23. Replies
    4
    Views
    4,240

    You're right, I didn't post that code because I'm...

    You're right, I didn't post that code because I'm sure that there wasnt a problem. All the things you mentioned are all there.
    Thx for the quick reply, that wiki page I have also used a lot and is...
  24. Replies
    4
    Views
    4,240

    I'm a shamed, because I had lots of errors and...

    I'm a shamed, because I had lots of errors and didnt know when to use -> or when to use . So I just was using some trial and error. But It seem it had nothing to do with that :)
  25. Replies
    4
    Views
    4,240

    Bmp read out only red value

    People,

    I have a little problem and I don't seem to get. I've seen examples that worked this way but mine won't.




    typedef struct
    {
    BYTE rgbtBlue;
Results 1 to 25 of 44
Page 1 of 2 1 2