[GDI +] Create two ways of images

xiaoxiao2021-03-06  113

Use the Bitmap to complete a new image object, size is xsize, ysize

[C #] bitmap myimage

=

New

Bitmap

<

xsize

>

,

<

ysize

>

);

[Vb]

DIM

MyImage as

New

Bitmap

<

xsize

>

,

<

ysize

>

)

Below this method creates an image owned image of a default color depth, or uses a pixel formatted parameter configuration.

[C #] bitmap myimage

=

New

Bitmap

<

xsize

>

,

<

ysize

>

Pixelformat.

<

Format

>

);

[Vb]

DIM

MyImage as

New

Bitmap

<

xsize

>

,

<

ysize

>

Pixelformat.

<

Format

>

)

Pixel Formats valid for the creation of a bitmap image are: Format16bppArgb1555 Format16bppGrayScale Format16bppRgb555 Format16bppRgb565 Format1bppIndexed Format24bppRgb Format32bppArgb Format32bppPArgb Format32bppRgb Format48bppRgb Format4bppIndexed Format64bppArgb Format64bppPArgb Format8bppIndexed Images can be loaded from disk in a standard format bitmap file (JPEG, GIF, TIFF or windows Bitmap) can be used Method Image.FromFile loads the specified image file

[C #] Bitmap BM

=

(Bitmap) image.fromfile

"

"

);

[Vb]

DIM

BM

AS

Bitmap

=

Ctype

(Image.fromfile

"

"

>

), Bitmap)

[to be continued...]

转载请注明原文地址:https://www.9cbs.com/read-101251.html

New Post(0)