|
|
Comments and Discussions
|
|
 |
|

|
How can I increase speed of redraw image, when I using scrolling on big images?
In demo project for drawing you using next code:
for (int y=rc.top ; y < rc.bottom ; y++)
{
int sy = yt[y] ;
for (int x=rc.left ; x < rc.right ; x++)
{
int sx = xt[x] ;
if (imgLayer.IsInside (sx,sy))
{
RGBQUAD cr = *(RGBQUAD*)imgLayer.GetBits (sx,sy) ;
FCColor::AlphaBlendPixel (view_img.GetBits(x,y), cr) ;
}
}
}
How to replace this to use BitBlt?
If I use BitBlt in OnDraw, then I can't draw with zoom scale(scale always be "1").
|
|
|
|

|
I hope there will still be anyone able to support me.
I tried with above sample to draw text into the FCObjImage object, but without any success.
Even trying to use above code snippets, I simply get the checkered image, but without any text into it, either Gdi or Gdi+ !!
Thanks in advance
StefanoA
|
|
|
|

|
hi, could you send your sample code to my mail, I try to it
crazybitwps@hotmail.com
|
|
|
|

|
Just to make it more clear,
this is the code I tried to insert and run without getting any text: only checkered image
I already did many tests trying to solve the problem without success,
please help!
FCObjImage img ;
img.Create (300, 200, 24) ;
img.ApplyEffect (FCEffectFillGrid(FCColor(192,192,192), FCColor(255,255,255), 16)) ;
HDC dc = FCImageDrawDC(img);
SetTextColor (dc, RGB(0,0,255)) ;
TextOut (dc, 0, 0, _T("PhoXo"), 5) ;
Gdiplus::Graphics g(dc) ;
g.SetSmoothingMode (Gdiplus::SmoothingModeAntiAlias) ;
g.SetInterpolationMode (Gdiplus::InterpolationModeHighQualityBicubic) ;
Gdiplus::FontFamily ffami (L"Arial") ;
Gdiplus::StringFormat fmt ;
Gdiplus::GraphicsPath str_path ;
str_path.AddString (L"PhoXo", -1, &ffami,
Gdiplus::FontStyleBold, 48, Gdiplus::Point(20,20), &fmt) ;
Gdiplus::Pen gp (Gdiplus::Color(0,0,160), 8) ;
gp.SetLineJoin (Gdiplus::LineJoinRound) ;
Gdiplus::Rect rc (20, 20, 30, 60) ;
Gdiplus::Color cStart (255,255,255) ;
Gdiplus::Color cEnd (0,128,255) ;
Gdiplus::LinearGradientBrush gb (rc, cStart, cEnd,
Gdiplus::LinearGradientModeVertical) ;
g.DrawPath (&gp, &str_path) ;
g.FillPath (&gb, &str_path) ;
img.Save (L"test.png") ;
|
|
|
|

|
because FCImageDrawDC is local object, its life circle only one line.
followed code is ok.
FCObjImage img ;
img.Create (300, 200, 24) ;
img.ApplyEffect (FCEffectFillGrid(FCColor(192,192,192), FCColor(255,255,255), 16)) ;
std::auto_ptr<FCImageDrawDC> memDC(new FCImageDrawDC(img)) ;
HDC dc = *memDC;
SetTextColor (dc, RGB(0,0,255)) ;
TextOut (dc, 0, 0, _T("PhoXo"), 5) ;
Gdiplus::Graphics g(dc) ;
g.SetSmoothingMode (Gdiplus::SmoothingModeAntiAlias) ;
g.SetInterpolationMode (Gdiplus::InterpolationModeHighQualityBicubic) ;
Gdiplus::FontFamily ffami (L"Arial") ;
Gdiplus::StringFormat fmt ;
Gdiplus::GraphicsPath str_path ;
str_path.AddString (L"PhoXo", -1, &ffami,
Gdiplus::FontStyleBold, 48, Gdiplus::Point(20,20), &fmt) ;
Gdiplus::Pen gp (Gdiplus::Color(0,0,160), 8) ;
gp.SetLineJoin (Gdiplus::LineJoinRound) ;
Gdiplus::Rect rc (20, 20, 30, 60) ;
Gdiplus::Color cStart (255,255,255) ;
Gdiplus::Color cEnd (0,128,255) ;
Gdiplus::LinearGradientBrush gb (rc, cStart, cEnd,
Gdiplus::LinearGradientModeVertical) ;
g.DrawPath (&gp, &str_path) ;
g.FillPath (&gb, &str_path) ;
img.Save (L"d:\\test.png") ;
memDC.reset() ;
|
|
|
|

|
Ok, thanks a lot!
So must be created+used+destroyed everytime I need to draw on the FCObjImage like follows?
I found that if I don't release the DC by deleting mem_dc pointer, the Draw function is no more able to show the image on the screen. Is that correct?
mem_dc = new FCImageDrawDC(img_dsp);
HDC dc = *mem_dc;
SetTextColor( dc, RGB(0,0,255)) ;
TextOut( dc, 20, 20, "TEXT 1", 6 );
SetTextColor( dc, RGB(255,0,0)) ;
TextOut( dc, 20, 40, "TEXT 2", 6 );
delete mem_dc;
mem_dc = NULL;
|
|
|
|

|
FCImageDrawDC is just a wrapper class of HDC, it use standard Win32 method to implement draw text on image.
|
|
|
|

|
When i include the class, i have got this error when i debug program:
1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\GdiplusTypes.h(418): error RC2021: expected exponent value, not 1>
1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\GdiplusTypes.h(418): error RC2021: expected exponent value, not 1>
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\memory.h(49): warning RC4011: identifier truncated to 1>
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\memory.h(71): warning RC4011: identifier truncated to 1>
1>include/effect/effect_ext.h(300): error RC2021: expected exponent value, not 1>
1>C:\Users\Adrian\Documents\Visual Studio 2010\Projects\test\test\Debug\RCa00476(60): fatal error RC1116: RC terminating after preprocessor errors
1>
1>
Have you got solution?
Visual Studio 2010 Ultimate trial
|
|
|
|

|
Hi,
Can you please provide code or the algorithm for the below function from Class "FCEffectBlur_Gauss". Need to understand the logic behind making an image blur.
virtual void OnFinishPixel (FCObjImage& img, int x, int y, BYTE* pPixel) {}
Regards,
MB
|
|
|
|

|
you can refer file \image_stone\include\effect\blur_gauss.h in package.
|
|
|
|

|
You did a good job!
Great article, 5 out of 5!
My Favorite Quote is:
"Failure is the beginning of Success"
|
|
|
|
|

|
I am using Freeimage library in my application to load image, and wanted to add some image effects.As most of the work done is through freeimage i dont want to change the loading image pattern of freeimage to imagestone . How can i add imagestone effects to my application with out using the load funtion of FCObjImage class. Is it possible to use ImageStone's classes through Freeimage Lib directly. Thanks, in Advance
|
|
|
|

|
you can use following code to implement convert.
FIBITMAP * src ;
FCObjImage img ;
FCImageCodec_FreeImage::LoadImage(src, img) ;
img.ApplyEffect (FCEffectFlip()) ;
FIBITMAP * dest = FCImageCodec_FreeImage::AllocateFreeImage(img) ;
|
|
|
|

|
Is there any way to make a large image file print across multiple pages without some preprocessing of the image to break it into chunks? For instance: I have a bitmap image that is 2550px wide by say 10,000px high. If I print, it prints all image data to one page.
|
|
|
|

|
Hi,
According to your other thread (PCL i.e. Phoxo core library), Image stone is the new version of PCL.
But what's about the Region management? (not only rectangle regions but any region wich are basically a set of bits telling if each pixel in the image is or isn't into the region)
1. are the effects/manipulations acting on the region of an image or do they proceed always on the entire image?
2. How can I add the region (ROI) into the image, so that the image effect only process on the region?
3. Is there specific function that manage regions? (create/delete, add etc...)
Many thx in advance.
|
|
|
|

|
Hi, superb library!
My imaging program uses (and is build on) GDI+ Image class, and for example, loads images with this kind of code:
Image* pImage = Image::FromFile(lpwstr);
I have then 2 main questions:
1. How can I convert FCObjImage into Image object (I've read that this conversion is easy for HBITMAPS....)
2. how can I get some kind of realtime effects on my displayed Image objects, like in the demo program, when you adjust the brightness for example...
Many thx in advance.
BTW, I am trying to contact you in your PhoXo company without success
|
|
|
|

|
I'm sorry for reply so later.
about these two questions:
1 ) member method CreateBitmap in FCObjImage can do it, such as:
Gdiplus::Image * pImg = img.CreateBitmap() ;
2 ) this is not one or two sentences to make it clear, you need create a thread to process image to avoid blocking UI response. reference dlg_effect_base.h and dlg_effect_base.cpp in demo program source code
|
|
|
|

|
Thx crazybit, but...
It seems that the CreateBitmap returns a Bitmap, not an Image, or did I miss something?
(in image.h)
Gdiplus::Bitmap* CreateBitmap (int nTransparencyIndex=-1) const ;
BTW, I am trying to contact you without success Is there a way to get in touch with you directly? Thank you.
|
|
|
|

|
Bitmap is derived class from Image, it can converted to Image safely.
Gdiplus::Image * img = img.CreateBitmap() ;
|
|
|
|
|

|
Very useful, to point out these types of image libs
|
|
|
|
|
|
 |
|
|
General News Suggestion Question Bug Answer Joke Rant Admin
|
An article on a library for image manipulation
| Type | Article |
| Licence | Zlib |
| First Posted | 24 Mar 2006 |
| Views | 384,701 |
| Downloads | 37,966 |
| Bookmarked | 368 times |
|
|