Thread: CBitmap + big images = bad?

  1. #16
    Registered User dug's Avatar
    Join Date
    Jun 2003
    Posts
    66
    there must be some trick... because photoshop can view the images... you see, we want to be able to see the whole image [zoomed out of course] and be able to see at 100% as well [obviously this would just be a small region of the image]... so i'm going to have to make a smaller image from the big image... i guess for 1/8 size i could just create a new image.... and use every 8th pixel value horizontally and vertically.... and then depending on zoom value... 1/4 size would be every 4th pixel or something... but it seems a bit inefficient to me to have to create a new bitmap from the large data every time you scroll/zoom.... i dunno.... i think of something hopefully...

  2. #17
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    This is just a guess...........

    Got a 64Mb graphics card?

    Correct me if I am wrong, but a 4000*4000 bmp with 32bit colour is just under 64Mb.

    CreateBitmap() and CreateCompatibleBitmap() (which should be used to create colour bitmaps as it improves performance) are device dependant.

    You could try CreateDIBSection() to create a device independent bitmap.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  3. #18
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    Novacain:

    I've never done this, and don't have time to try right now, but have you ever blitted from multiple back buffers to a displayed DC that has a world transform applied to it, (in GM_ADVANCED mode), with the XFORM.eM11 and XFORM.eM22 matrix members set to a fractional value?

    If that works, then the world transform would scale the various blits and produce a composite "zoomed out" view, and by changing the matrix values, progressive "zoom ins" could be acheived, all without ever loading the whole bitmap into a singe structure.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  4. #19
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    Sorry, we are in acceptance testing, again, so very busy...

    >>but have you ever blitted from multiple back buffers to a displayed DC that has a world transform applied to it,

    Have not done a lot with world transforms on multiple or composite images.
    Should work, would probably have to use some overlap and experiment to get it aligned.

    StretchBlt() will not work IMHO. The results will be poor (even with HALFTONE set) and the drawing slow. Best results would be achived with int multiples.

    Use a image lib that has some good, fast image resizing functions for jpg's (ImageSource by Small Animals Software). I use this to resize the area of an image for zoom ect. My stuff is designed for 56k internet and so uses small compressed images.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. images, icons, and cursors, OH MY!
    By DarkViper in forum Windows Programming
    Replies: 3
    Last Post: 01-07-2003, 02:26 PM
  2. Shocking(kind of)
    By Shadow in forum A Brief History of Cprogramming.com
    Replies: 25
    Last Post: 12-10-2002, 08:52 PM
  3. UNICODE and GET_STATE
    By Registered in forum C++ Programming
    Replies: 1
    Last Post: 07-15-2002, 03:23 PM
  4. A simple question on Images....
    By LonelyPlanetWa in forum C Programming
    Replies: 7
    Last Post: 05-20-2002, 07:34 AM
  5. good news and bad news
    By Garfield in forum A Brief History of Cprogramming.com
    Replies: 25
    Last Post: 10-27-2001, 07:31 AM