Jump to content

PM2DImage: Difference between revisions

From EDM2
Ak120 (talk | contribs)
mNo edit summary
 
(7 intermediate revisions by one other user not shown)
Line 1: Line 1:
extends PM2Drawable as public
Extends PM2Drawable as public


2D PNG Image class.
2D PNG Image class.
Line 13: Line 13:
== Contents ==
== Contents ==
          
          
{| border="1"
{|class="wikitable"
!Entity||Inherited From||Type||Scope||Short Description
|-
|-
!Entity
|PM2DImage|| ||constructor||public||Constructs the bitmap image object.
!Inherited From
!Type
!Scope
!Short Description
|-
|PM2DImage
|  
|constructor  
|public
| Constructs the bitmap image object.
 
|-
|-
|PM2DImage
|PM2DImage|| ||constructor||public||Constructs the bitmap image object from another object.
|  
|constructor  
|public
|Constructs the bitmap image object from another object.
 
|-
|-
|operator =
|operator =|| ||operator||public||Assigns the value of one bitmap object to another.
|  
|operator  
|public
|Assigns the value of one bitmap object to another.
 
|-
|-
|handle
|handle|| ||method||public||Returns the bitmap handle.
|  
|method  
|public
|Returns the bitmap handle.
 
|-
|-
|rectangle
|rectangle|| ||method||public||Returns the bitmap rectangle.
|  
|method  
|public
|Returns the bitmap rectangle.
 
|-
|-
|bound
|bound|| ||method||public||Return the bounding rectangle for this image.
|  
|method  
|public
|Return the bounding rectangle for this image.
 
|-
|-
|move
|move|| ||method||public||Moves image to another position.
|  
|method  
|public
|Moves image to another position.
 
|-
|-
|draw
|draw|| ||method||public||Draws the bitmap to the specific presentation space.
|  
|method  
|public
|Draws the bitmap to the specific presentation space.
 
|}
|}


Line 81: Line 36:
Constructs the bitmap image object.
Constructs the bitmap image object.


Load a PNG bitmap image from the specified resource library
Load a PNG bitmap image from the specified resource library with its specified bitmap identifier. If you have not already loaded the bitmap and you want load it from the
with its specified bitmap identifier. If you have not
already loaded the bitmap and you want load it from the
default resource library, use this constructor.
default resource library, use this constructor.


; Source: pm_2dimage.h:46  
; Source: pm_2dimage.h:46
 
; Params:  
; Params:  
{| border="1"
{| border="1"
|-
|-
|''x
|''x''
''
|Horizontal position of the bitmap.
|Horizontal position of the bitmap.
|-
|-
|''y
|''y''
''
|Vertical position of the bitmap.
|Vertical position of the bitmap.
|-
|-
|''res_id
|''res_id''
''
|The identifier of the bitmap.
|The identifier of the bitmap.
|-
|-
|''hmodule
|''hmodule''
''
|Module handle referencing a dynamic link library containing the resource or NULLHANDLE for the application's module.
|Module handle referencing a dynamic link library containing the
|}
                resource or NULLHANDLE for the application's module.


|} 
;Code:
 
<PRE>
; '''Code:'''
public PM2DImage ( LONG x ,
{| border="1"
            LONG y ,
|-
            SHORT res_id ,
|public ''''''PM2DImage'''''' (
            HMODULE hmodule )
| LONG x ,
</PRE>
|-
|
| LONG y ,
|-
|
| SHORT res_id ,
|-
|
| HMODULE hmodule )
|}


== constructor PM2DImage ==
== constructor PM2DImage ==
Constructs the bitmap image object from another object.


Constructs the bitmap image object from another object.
;Source: pm_2dimage.h:49
'''Source:'''pm_2dimage.h:49 '''Code:'''
;Code:
{| border="1"
public PM2DImage (const PM2DImage & )
|-
|public ''''''PM2DImage'''''' (
| '''const''' '''PM2DImage''' &amp; )
|} 


== operator = ==
== operator = ==
Assigns the value of one bitmap object to another.


Assigns the value of one bitmap object to another.
; Source: pm_2dimage.h:51
'''Source:'''pm_2dimage.h:51 '''Code:'''
; Code:
{| border="1"
public PM2DImage & operator = (const PM2DImage & )
|-
|public '''PM2DImage''' &amp; ''''''operator ='''''' (
| '''const''' '''PM2DImage''' &amp; )
|}


== method handle ==
== method handle ==
Returns the bitmap handle.
Returns the bitmap handle.
'''Source:'''pm_2dimage.h:54 '''Code:'''
; Source: pm_2dimage.h:54
{| border="1"
; Code:
|-
public HBITMAP2 handle () const
|public HBITMAP2 ''''''handle'''''' (
| ) '''const'''
|}


== method rectangle ==
== method rectangle ==
Returns the bitmap rectangle.
Returns the bitmap rectangle.
'''Source:'''pm_2dimage.h:57 '''Code:'''
; Source: pm_2dimage.h:57
{| border="1"
; Code:
|-
public virtual PMRect rectangle () const
|public '''virtual''' [[PMRect]] ''''''rectangle'''''' (
| ) '''const'''
|}


== method bound ==
== method bound ==
Return the bounding rectangle for this image.
Return the bounding rectangle for this image.
'''Source:'''pm_2dimage.h:59 '''Code:'''
; Source: pm_2dimage.h:59
{| border="1"
; Code:
|-
public virtual PMRect bound ( ) const
|public '''virtual''' [[PMRect]] ''''''bound'''''' (
| ) '''const'''
|}


== method move ==
== method move ==
Moves image to another position.
Moves image to another position.
'''Source:'''pm_2dimage.h:61 '''Code:'''
; Source: pm_2dimage.h:61
{| border="1"
; Code:
|-
public virtual void move ( LONG x ,
|public '''virtual''' '''void''' ''''''move'''''' (
                    LONG y )
| LONG x ,
|-
|
| LONG y )
|}
 
== method draw ==
== method draw ==
Draws the bitmap to the specific presentation space.
Draws the bitmap to the specific presentation space.
'''Source:'''pm_2dimage.h:64 '''Code:'''
; Source:pm_2dimage.h:64
{| border="1"
: Code:
|-
public virtual void draw (HPS hps )
|public '''virtual''' '''void''' ''''''draw'''''' (
 
| HPS hps )
|}
[[Category:Glass PM C++ API]]
[[Category:Glass PM C++ API]]

Latest revision as of 13:43, 10 July 2020

Extends PM2Drawable as public

2D PNG Image class.

The PM2DImage class accesses and manages PNG bitmap resources through reference-counting. Reference-counting allows the system to use one bitmap in multiple places. The library maintains the lifetime of this bitmap until all users are finished with it.

You can construct, destruct, copy, and assign objects of this class.

Source
pm_2dimage.h:28
Author
Dmitry A Steklenev
Version
1.0

Contents

Entity Inherited From Type Scope Short Description
PM2DImage constructor public Constructs the bitmap image object.
PM2DImage constructor public Constructs the bitmap image object from another object.
operator = operator public Assigns the value of one bitmap object to another.
handle method public Returns the bitmap handle.
rectangle method public Returns the bitmap rectangle.
bound method public Return the bounding rectangle for this image.
move method public Moves image to another position.
draw method public Draws the bitmap to the specific presentation space.

constructor PM2DImage

Constructs the bitmap image object.

Load a PNG bitmap image from the specified resource library with its specified bitmap identifier. If you have not already loaded the bitmap and you want load it from the default resource library, use this constructor.

Source
pm_2dimage.h:46
Params
x Horizontal position of the bitmap.
y Vertical position of the bitmap.
res_id The identifier of the bitmap.
hmodule Module handle referencing a dynamic link library containing the resource or NULLHANDLE for the application's module.
Code
 public PM2DImage ( LONG x ,
	            LONG y ,
	            SHORT res_id ,
	            HMODULE hmodule )

constructor PM2DImage

Constructs the bitmap image object from another object.

Source
pm_2dimage.h:49
Code
public PM2DImage (const PM2DImage & )

operator =

Assigns the value of one bitmap object to another.

Source
pm_2dimage.h:51
Code
public PM2DImage & operator = (const PM2DImage & )

method handle

Returns the bitmap handle.

Source
pm_2dimage.h:54
Code
public HBITMAP2 handle () const

method rectangle

Returns the bitmap rectangle.

Source
pm_2dimage.h:57
Code
public virtual PMRect rectangle () const

method bound

Return the bounding rectangle for this image.

Source
pm_2dimage.h:59
Code
public virtual PMRect bound (	) const

method move

Moves image to another position.

Source
pm_2dimage.h:61
Code
public virtual void move ( LONG x ,

LONG y )

method draw

Draws the bitmap to the specific presentation space.

Source
pm_2dimage.h:64
Code:
public virtual void draw (HPS hps )