English
Source / code snippets

Image turn Gdiplus Image Jpg Rotation Save

 
Related: turn without GDI+:  [...] 
Thanks on Andreas Miethe!
example :
 $H windows.ph
 $H includes\Functions_GDIPLUS.ph
 $H includes\GDIP_Imageging.ph
 $I includes\GDIP_Helper.inc
Declare gdiplusToken&,ImageObject&,GraphicObject&,ImageWidth&,ImageHeight&
Declare SIO&,DC&,BMP&,Brush&
CLS ~GetSysColor(~COLOR_3DFACE)
gdiplusToken& = InitGDIPlus()GDIPlus started
Image loading
ImageObject& = gdipLoadImage(eisbaer.jpg) way adjust

If ImageObject&

    ~GdipGetImageWidth(ImageObject&,ADDR(ImageWidth&))wide detect
    ~GdipGetImageHeight(ImageObject&,ADDR(ImageHeight&))Hoehe detect
    DC& = ~CreateCompatibleDC(%hdc)SpeicherDC
    wide and Höhe errechnet itself from the Bilddiagonalen
    BMP& = ~CreateCompatibleBitmap(%hdc,INT(Sqrt((ImageWidth&^2)+(ImageHeight&^2))),INT(Sqr t((ImageWidth&^2)+(ImageHeight&^2))))Memory bitmap
    Brush& = ~CreateSolidBrush(RGB(0,0,0))Brush
    ~SelectObject(DC&,BMP&)Memory bitmap in SpeicherDC
    ~SelectObject(DC&,Brush&)Brush for SpeicherDC
    ~Rectangle(DC&,0,0,491,491)rectangle draw
    ~GdipCreateFromHDC(DC&,ADDR(GraphicObject&))Graphics-of SpeicherDC
    ~GdipRotateWorldTransform(GraphicObject&,Single(45.0),1)Rotation settle
    ~GdipDrawImageRectI(GraphicObject&,ImageObject&,(ImageHeight&/2),-(ImageHeight&/ 2),ImageWidth&,ImageHeight&)
    ~GdipCreateBitmapFromHBITMAP(BMP&,0,Addr(SIO&))Image of Memory bitmap
    SaveAsJPG(SIO&,AX.jpg,30) Image Save
    straighten up
    ~GdipDeleteGraphics(GraphicObject&)
    ~GdipDisposeImage(ImageObject&)
    ~GdipDisposeImage(SIO&)
    ~DeleteObject(BMP&)
    ~DeleteObject(Brush&)
    ~DeleteDC(DC&)

Endif

Print ready
Waitinput
ExitGDIPlus(gdiplusToken&) GDIPlus terminate
End
salvo, iF.
 
11/16/05  
 



where wars I this Files since for GDIPlus?

mfg

$H includes\Functions_GDIPLUS.ph
$H includes\GDIP_Imageging.ph
$I includes\GDIP_Helper.inc
 
02/15/09  
 



is correct, The are missing here  [...]  .
 
02/15/09  
 



Hello I have these demonstration now loaded.
The dog becomes beautiful as Sprite displayed, where The colour knows transparent is. Diesen worth have I on on :Single(1.0) set.

If I now with Paintshop The 1.wmf as 2.wmf abspeichere, is the knows not any more transparent at present.
How comes the?
 $H windows.ph
 $H includes\Functions_GDIPLUS.ph
 $H includes\GDIP_Imageging.ph
 $I includes\GDIP_Helper.inc
Declare gdiplusToken&,ImageObject&,ImageObject1&,GraphicObject&,Attributes&
Declare Color_Matrix#
CLS ~GetSysColor(~COLOR_3DFACE)
gdiplusToken& = InitGDIPlus()GDIPlus started
Farb-Matrix set up 5 X 5 SingleFloat-values
Dim Color_Matrix#,4*(5*5)
Long Color_Matrix#,0  = Single(1.0),Single(0),Single(0),Single(0),Single(0)ruddy
Long Color_Matrix#,20 = Single(0),Single(1.0),Single(0),Single(0),Single(0)green
Long Color_Matrix#,40 = Single(0),Single(0),Single(1.0),Single(0),Single(0)blue
to that testing whom worth 4 (0.6) change
Long Color_Matrix#,60 = Single(0),Single(0),Single(0),Single(1.0),Single(0)alpha
Long Color_Matrix#,80 = Single(0),Single(0),Single(0),Single(0),Single(1.0)
Image loading
ImageObject& = gdipLoadImage(eisbaer.jpg) way adjust
ImageObject1& = gdipLoadImage(2.wmf) way adjust

If ImageObject&

    and on %hWnd draw
    ~GdipCreateFromHWND(%hWnd,ADDR(GraphicObject&))any Graphics-Operationen on %hWnd
    Image 1 draw
    ~GdipDrawImageI(GraphicObject&,ImageObject&,120,0)Bitmap draw
    attributes lay out
    ~GdipCreateImageAttributes(Addr(Attributes&))
    Color_Matrix To whom Attributen
    ~GdipSetImageAttributesColorMatrix(Attributes&,~ColorAdjustTypeDefault,1,Color_Matrix#,0,~ColorAdjustTypeDefault)
    Image2 with Attributen draw
    ~GdipDrawImageRectRect(GraphicObject&,ImageObject1&,0.0,0.0,Single(400.0),Single(400.0),0.0,0.0,Single(400.0),Single(400.0),~UnitPixel,Attributes&,0,0)
    ~GdipDisposeImageAttributes(Attributes&)
    ~GdipDisposeImage(ImageObject&)
    ~GdipDisposeImage(ImageObject1&)
    ~GdipDeleteGraphics(GraphicObject&)
    Dispose Color_Matrix#

Endif

Waitinput
ExitGDIPlus(gdiplusToken&) GDIPlus terminate
End
 
02/15/09  
 



Please first of all  [...]  top up.
 
02/15/09  
 



what should I there top up...........
 
02/15/09  
 



The GDI+ Gibts with Microsoft.  [...] 
Download requires though Validation the Rechtmässigkeit.
 
02/15/09  
 



have The now already loaded, runs everything so far.

me goes it only around the question: Why is the 2.wmf not transparent?

mfg
 
02/15/09  
 



Peter Bierbachh
what should I there top up...........


Öhm, have The Header-Files auffindig make can?
 
02/16/09  
 



The have I in these demonstration found with the I now my experiemente make.
knows but not whether any command from the GDI include are.

mfg

505 kB
Hochgeladen:02/16/09
Downloadcounter205
Download
 
02/16/09  
 



Sag me rather, How I The wmf-File transparent abspeichern can with Paintshop.
 
02/16/09  
 




E.T.
@Peter: can because .wmf at all transparent ??
Have even time through div. Program geschaut, keines bid .wmf-Save with transparency on.
 
Grüße aus Sachsen... Mario
WinXP, Win7 (64 Bit),Win8(.1),Win10, Win 11, Profan 6 - X4, XPSE, und 'nen schwarzes, blinkendes Dingens, wo ich das alles reinschütte...
02/16/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

28.451 Views

Untitledvor 0 min.
Thomas Freier02/16/24
H.Brill09/27/23
Uwe Lang09/19/23
p.specht06/13/22
More...

Themeninformationen



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