picture1.TransformationReference = TransfomationReference.CreateAbsolute(Vector.Empty);
Frank Hileman wrote:ok, the RenderTo is not available to us yet, as we're still on the Lite version. I played around with the custom icon stuff with some simple 16x16 icons in visual studio, and I don't think that's what we're wanting anyway.
What we're trying to accomplish is a "faded/transparent" version of the Picture currently being dragged...much the same way the icons on your desktop show up when you drag them around (the original stays put, but there's a "copy" under the mouse....)
Could you clue us in on what we need to do to accomplish this?
Frank Hileman wrote:This is unfortunate. Once you have rendered to a bitmap, ColorMatrix can reduce opacity.
int h = Convert.ToInt32(_currentDrag.Size.Height);
int w = Convert.ToInt32(_currentDrag.Size.Width);
Bitmap b = new Bitmap(w,h);
Graphics g = Graphics.FromImage(b);
ScalingTranslation st = new ScalingTranslation(_currentDrag.Bounds, new FRectangle(0,0,w,h));
Transformation oldTrans = _currentDrag.Transformation;
_currentDrag.TransformationReference = TransformationReference.CreateAbsolute(Vector.Empty);
_currentDrag.Transformation = oldTrans;
Cursor.Current = new Cursor(@"c:\test.bmp");
The argument 'picture' must be a picture that can be used as a Cursor.\r\nParameter name: picture
Bitmap b = new Bitmap(w,h,System.Drawing.Imaging.PixelFormat.Format16bppArgb555); //,System.Drawing.Imaging.PixelFormat.Format8bppIndexed);
using Rect = System.Drawing.Rectangle;
// NOTE: add some extra pixels to width, height, to account for
// half stroke width, if you use strokes
Bitmap b1 = new Bitmap(w,h);
using (Graphics g1 = Graphics.FromImage(b1))
... the RenderTo code goes here ...
// now make it more transparent
ImageAttributes ia = new ImageAttributes();
ColorMatrix cm = new ColorMatrix();
cm.Matrix33 = 0.5F; //50% transparency
Bitmap b2 = new Bitmap(w,h);
using (Graphics g2 = Graphics.FromImage(b2))
new Rect(0, 0, b1.Width, b1.Height),
0, 0, b1.Width, b1.Height, GraphicsUnit.Pixel, ia);
// now b2 has the right data, you can dispose b1
Users browsing this forum: No registered users and 1 guest