English
Source / code snippets

Images Getdibits manipulation speedy Setdibits

 
with GetDiBits and SetDiBits can BMP-Images memory quick manipulating.
crude Description :
CompileMarkSeparation
bild_h& = Create(hPic, -1, test.bmp)
>
> becomes into memory red
CompileMarkSeparation
~GetDIBits(%hdc,bild_h&,0,bmi#.biHeight&,bildxy#,bmi#,0)
>
> Image in a Memory-Variable gepackt
CompileMarkSeparation
whileloop 128*4*10

    byte bildxy#,&loop=255

endwhil

Image manipulating with 128 weißen Pixeln (1 point exists from 4 Bytes > RGBA). The 1.point is under left ,1. row. The Reihen catch always left on. best is, if to the BMP-Image 128x128 Pixel power, then can well see, as downstairs 10 Reihen from weißen Pixeln consist.
CompileMarkSeparation
~setDIBits(%hdc,bild_h&,0,bmi#.biHeight&,bildxy#,bmi#,0)
> The Bereichsvaribale becomes again on the lever : bild_h& staid
CompileMarkSeparation
drawpic bild_h&,10,10,0
> one can now the changed Image in the Window see.

with XPIA/ASM has one again many possibilities to Manipulierung
or who whom DEV C++ has and ASM not likes, a speedy DLL-Solution produce around the area To change.

The demonstration :
CompileMarkSeparation
 $H windows.ph
declare presentment1$
declare hWin&
Window 20,20-600,450
Cls @RGB(220,220,220)
bild1$=car.bmp
erzeugebild(presentment1$)
var end%=1

WHILE end%

    sleep 1
    waitkey

ENDWHILE

proc erzeugebild

    parameters namebild$
    declare width%,height%
    declare bild_h&,a&
    declare bmi#,bildxy#
    mcls 0,0,0
    startpaint -1
    mloadbmp namebild$,0,0
    endpaint
    height%=%bmpy
    width%=%bmpx
    def &BI_RGB 0
    def &DIB_RGB_COLORS 0
    struct BITMAPINFOHEADER =
    biSize&, biWidth&, biHeight&, biPlanes%, biBitCount%, biCompression&,
    biSizeImage&, biXPelsPerMeter&, biYPelsPerMeter&, biClrUsed&, biClrImportant&
    dim bmi#,BITMAPINFOHEADER
    clear bmi#

    with bmi#

        .biSize&        = sizeof(bmi#)
        .biWidth&       = width%
        .biHeight&      = height%
        .biPlanes%      = 1
        .biBitCount%    = 32
        .biCompression& = &BI_RGB
        .biSizeImage&   = ((.biWidth& * .biBitCount%  8 - 1) | 3 + 1) * abs(.biHeight&)

    endwith

    bild_h& = Create(hPic, -1, namebild$)
    drawpic bild_h&,10,10,0
    a&=bmi#.biSizeImage&
    dim bildxy#,a&
    ~GetDIBits(%hdc,bild_h&,0,bmi#.biHeight&,bildxy#,bmi#,0)

    whileloop 128*4*10

        byte bildxy#,&loop=255

    endwhile

    ~setDIBits(%hdc,bild_h&,0,bmi#.biHeight&,bildxy#,bmi#,0)
    drawpic bild_h&,10,150,0
    dispose bmi#
    dispose bildxy#

endproc

 
08/19/08  
 



class Posting and beautiful declared!
 
08/19/08  
 




Frank
Abbing
so has iF The DIBs now finally too understood...
 
08/20/08  
 



I known the day would come...
 
08/20/08  
 



in the obigen code was one Error cache, I have from
CompileMarkSeparation
height%=%bmpx
width%=%bmpye>

CompileMarkSeparation
height%=%bmpy
width%=%bmpxe>
made.
 
02/24/09  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

5.410 Views

Untitledvor 0 min.
H.Brill09/15/21
AndreasS12/27/18
Heli9806/24/17
funkheld01/12/14
More...

Themeninformationen

this Topic has 3 subscriber:

iF (3x)
Frank Abbing (1x)
unbekannt (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie