Home > Software engineering >  Vb use Gdiplus. TLB how to save the pictures??
Vb use Gdiplus. TLB how to save the pictures??

Time:09-23

 'using Gdiplus TLB, put it in the system32, then add a reference to its 
'manually Form AutoRedraw=True, ScaleMode=Pixels
Option Explicit
Dim lngGraphics As Long
Dim lngImageHandle As Long
Dim lngTextureBrush As Long
Dim gpP As GpStatus
Dim lngPen1 As Long
Dim lngToken As Long
Dim GpInput As GdiplusStartupInput
Private Sub Command1_Click ()
Dim intP As Integer
GpP=GdipCreateFromHDC (Me. HDC, lngGraphics) 'create painting area equipment scene
GpP=GdipLoadImageFromFile (App) Path & amp; "\ startup. PNG," lngImageHandle) 'reads the images to memory
GpP=GdipDrawImage (lngGraphics lngImageHandle, 0, 0) 'size, such as map
GpP=GdipDrawImageRect (lngGraphics lngImageHandle, 200, 0, 300, 300) 'drawing in specified area (zoom in or out)
GpP=GdipDrawImageRectRectI (lngGraphics lngImageHandle, 550, 0, 400, 400, 20, 20, 80, 80, UnitPixel) 'display images in the area of the 400 * 400 parts
GpP=GdipCreateTexture (lngImageHandle WrapModeTile, lngTextureBrush) 'set a certain arrangement way of the brush tile
GpP=GdipFillRectangle (lngGraphics, lngTextureBrush, 0, 300, 400, 300) 'in the designated area in the specified format drawing picture
If lngGraphics & lt;> 0 Then GdipDeleteGraphics lngGraphics
If lngImageHandle & lt;> 0 Then GdipDisposeImage lngImageHandle
If lngTextureBrush & lt;> 0 Then GdipDeleteBrush lngTextureBrush
Me. Refresh
End Sub
Private Sub Form_Load ()
Dim bolP As Boolean

With Me
The Caption="GDIPlus paradigm"
Width=960 * 15
Height=720 * 15
. Left=(Screen Width - the Width) * 0.5
Top=(Screen. Height -. Height) * 0.5
End With
GpInput. GdiplusVersion=1
If lngToken=0 Then bolP=(GdiplusStartup (lngToken GpInput)=Ok)
End Sub

CodePudding user response:

Use GDI + drawing, after Me. The Image attributes, is "the Image window"?
Keep it down not to go?
  • Related