Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GDI+ how to increase transparancy
Message
From
31/08/2012 08:00:45
Walter Meester
HoogkarspelNetherlands
 
 
To
31/08/2012 04:43:23
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01551689
Message ID:
01552126
Views:
62
>Wanted to try this myself. Where do you read original bitmap to be deemed ?
>Or you do it in some previous code. Why don't you post picture of result ?

Here is what I used for testing. Also see image attached
CLEAR ALL
CLEAR
CLEAR RESOURCES


DO source\programs\system && load GDI++
LOCAL loBitmap AS xfcBitmap
LOCAL loNewBitmap AS xfcBitmap
LOCAL loGfx AS xfcGraphics
LOCAL loAttr AS xfcImageAttributes
LOCAL loClrMatrix AS xfcColorMatrix
LOCAL loRect AS xfcRectangle 

WITH _SCREEN.System.Drawing 
	cFile1 = "D:\TAX\IDS5.3\SOURCE\BMPS\PRESENTPATIENT_32.PNG"
	loBitmap = .Bitmap.New(cFile1)

	loNewBitmap = .Bitmap.New(loBitmap.Width, loBitmap.Height) 
	* Create a Graphics object to be able to draw in the bitmap
	loGfx = .Graphics.FromImage(loNewBitmap) 
	loClrMatrix = .Imaging.ColorMatrix.New( ;
	   1 ,  0,  0,  0,  0, ;
	   0 ,  1,  0,  0,  0, ;
	   0 ,  0,  1,  0,  0, ;
	   0 ,  0,  0, .4,  0, ;
	   0 ,  0,  0,  0,  1)
	loAttr = .Imaging.ImageAttributes.New()
	loAttr.SetColorMatrix(loClrMatrix)
	loRect = .Rectangle.New(0,0,loBitmap.Width, loBitmap.Height)
	loGfx.DrawImage(loBitmap, loRect, loRect, .GraphicsUnit.Pixel, loAttr) 

	cFile = "d:\tax\ids5.3\NewImage.png"

	loNewBitmap.Save(cFile, .Imaging.ImageFormat.png)

	_Screen.AddObject("image1","Image")
	_Screen.image1.Picture = cFile
	_Screen.image1.move(10,10)
	_Screen.image1.Visible = .T.


	_Screen.AddObject("image2","Image")
	_Screen.image2.Picture = cFile1
	_Screen.image2.move(60,10)
	_Screen.image2.Visible = .T.
ENDWITH
Previous
Reply
Map
View

Click here to load this message in the networking platform