• Welcome to Vampyre Imaging Library Forum. Please login or sign up.
 

Size of ImagingCanvas?

Started by davem, 24 May 2012, 11:23:39

Previous topic - Next topic

davem

Hi
is it possible to find out the width and height of an ImagingCanvas?

And second question - if I want to create a visual effect on an image with partial transparency (for example the corners fading to black or white), what approach do you suggest? I assume merging two images somehow?

And last question - what is the difference between DrawAlpha and DrawBlend?

   Thanks, David

Galfar

Hi,

@canvas size:
the canvas always spans the entire underlying image so the size of canvas is the same.
You can restrict canvas operations to clip rect area (by default clip rect is the whole canvas/image
so you could get canvas width and height by Canvas.ClipRect.Right and Canvas.ClipRect.Bottom).

@fading effect:
you mean like gradient fade? If yes then merging the images would probably be faster than painting the gradient
itself. You would have background image and alpha blend a prepared image with some fading effect onto it.

@blend vs alpha:
DrawBlend is general function with custom blending parameters for source and destination pixels.
DrawAlpha and DrawAdd are just DrawBlend with specific parameters set to get the desired effect.
You can experiment with blendign parameters and see what you'll get :)


Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Name:
Email:

Shortcuts: ALT+S save/post or ALT+P preview

SMF spam blocked by CleanTalk