My first program, create and display bitmap

xiaoxiao2021-03-06  25

Note that the Source and Library added in MMP are used in order to compile and connect. Create multiple block diagrams, add: start bitmap pic.mbm // Create MBM

TargetPath ../../../wins/c/system/apps/map2 // MBM storage location

HEADER

SourcePath ../AIF // Picture Position

Source C12 Back.BMP // 0 // Name

Source C12 Ball.BMP // 1

SOURCE C12 BALL_MASK.BMP / / 2

End

Then compiled in CMD, in ../../../Wins/c/system/apps/map2 generated PIC.MBM This stuff is a multi-position diagram, which produces PICs under include. MBG is a resource file to record the order of these pictures. Two ways to create Image:

1 Through EIKENV.H, IEikonenv (Ceikonenv's Static Object), IEikonenv-> CreateBitmapl (Const TDesc & AFileName, Tint Aid), the path and name of the AfileNMAE image, the ranking of AID in Bitmap.

2 Direct initialization cfbsbitmap * bitmap = new (Eleave) cfbsbitmap (); objects of cfbsbitmap or cwsbitmap, with Bitmap-> Load (AID); Creating a bitmap service with CWSBitmap is fast than Cfbsbitmap. CWSBitmap inherits in cfbsbitmap.

Show pictures by cwindowgc & gc = systemgc ();

GC.Bitblt (const tpint & apos, const cfbsbitmap * adevice);

Create a double buffer method:

1 Create a picture of a screen size first

Cfbsbitmap * bitmap = new (eleave) cfbsbitmap ();

Bitmap-> Create (Const Tsize & AsizeInpixels, TDisplayMode Adispmode);

2 Create a brush

CfbsbitmapDevice * bitmapDevice = cfbsbitmapDevice :: newl (cfbsbitmap * afbsbitmap);

Cfbsbitgc * graphicsContext = NULL;

BitmapDevice.createContext (GraphicsContext)

3 Drawing in the created picture

GraphicsContext -> Bitblt (TPOINT (0, 0), IBACKGROUNDIMAGE);

4 display on the screen

CWINDOWGC & GC = systemgc ();

gc.bitblt (Rect (). ITL, IOFFSCREENBITMAP;

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

New Post(0)